I am using Ubuntu 14.04 and have installed nodejs and npm with:
sudo apt-get install nodejs npm
Then I made a symlink to enable packages to use the node interpreter (instead of nodejs):
sudo ln -s /usr/bin/nodejs /usr/local/bin/node
I installed coffee-script (for testing purposes) and my own package, mangarack, with:
sudo npm -g install coffee-script mangarack
When I run coffee (part of coffee-script), that package will run fine. If I run mangarack, I will get:
: No such file or directory.
I have the following in my package.json:
"bin": {
"mangarack": "./bin/mangarack"
},
And that file contains:
#!/usr/bin/env node
require('../lib/cli/index');
I looked at how coffee-script did it and it seems like my require statement is absolutely wrong, so I replaced that with a console.log statement to see if the file would actually run in node. It doesn't. What did I miss or miss-configure to enable Linux-based machines to run this package?
Full source code references:
npm: https://www.npmjs.org/package/mangarack
git: https://github.com/Deathspike/mangarack.js
The problem is the file bin/mangarack uses carriage return, which causes error in linux environment. see what I got:
$ mangarack --help
env: node\r: No such file or directory
$ head -n 1 `which mangarack` | hexdump
0000000 23 21 2f 75 73 72 2f 62 69 6e 2f 65 6e 76 20 6e
0000010 6f 64 65 0d 0a
0000015
Notice the character \r(0d in hex mode) after node. you should remove it.
Solution: setup your project with $ git config core.autocrlf then commit changes afterwards. see https://help.github.com/articles/dealing-with-line-endings/
the expected result after fix should be:
$ head -n 1 `which mangarack` | hexdump
0000000 23 21 2f 75 73 72 2f 62 69 6e 2f 65 6e 76 20 6e
0000010 6f 64 65 0a
0000015
Related
I'm running on a problem. My Laravel project is an old one, and I can't run npm run dev.
Let's see some code:
php artisan laravel --version: Laravel Framework 5.8.38
node --version: v16.16.0 This is the actual version of Node installed
And the error when running NPM:
MacBook-Pro-de-Marcello:webroker marcellopato$ npm run dev
npm WARN npm npm does not support Node.js v16.16.0
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 6, 8, 9, 10, 11.
npm WARN npm You can find the latest version at https://nodejs.org/
> # dev /Users/marcellopato/Documents/Sites/webroker
> npm run development
npm WARN npm npm does not support Node.js v16.16.0
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 6, 8, 9, 10, 11.
npm WARN npm You can find the latest version at https://nodejs.org/
> # development /Users/marcellopato/Documents/Sites/webroker
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
node:events:505
throw er; // Unhandled 'error' event
^
Error: spawn node_modules/webpack/bin/webpack.js ENOENT
at Process.ChildProcess._handle.onexit (node:internal/child_process:283:19)
at onErrorNT (node:internal/child_process:478:16)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (node:internal/child_process:289:12)
at onErrorNT (node:internal/child_process:478:16)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
errno: -2,
code: 'ENOENT',
syscall: 'spawn node_modules/webpack/bin/webpack.js',
path: 'node_modules/webpack/bin/webpack.js',
spawnargs: [
'--progress',
'--hide-modules',
'--config=node_modules/laravel-mix/setup/webpack.config.js'
]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! # development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # development script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/marcellopato/.npm/_logs/2022-08-29T14_40_33_577Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! # dev: `npm run development`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/marcellopato/.npm/_logs/2022-08-29T14_40_33_659Z-debug.log
The package.json:
"private": true,
"scripts": {
"dev": "npm run development",
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch-poll": "npm run watch -- --watch-poll",
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"prod": "npm run production",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
},
"devDependencies": {
"axios": "^0.18.0",
"bootstrap": "^4.1.3",
"cross-env": "^5.2.0",
"jquery": "^3.2",
"laravel-mix": "^2.1.14",
"lodash": "^4.17.11",
"popper.js": "^1.14.3",
"vue": "^2.5.16",
"vuedraggable": "^2.16.0"
},
"dependencies": {
"#tinymce/tinymce-vue": "^1.1.0",
"#websanova/vue-upload": "^0.2.14-beta",
"ajv": "^6.5.4",
"jquery-filepond": "^1.0.0",
"laravel-echo": "^1.4.0",
"moment": "^2.22.2",
"moment-timezone": "^0.5.21",
"node-sass": "^4.9.4",
"npm": "^6.4.1",
"pusher-js": "^4.3.1",
"tinymce-vue-2": "0.0.5",
"v-calendar": "^0.9.7",
"vlightbox": "^2.0.2",
"vue-chat-scroll": "^1.2.0",
"vue-google-charts": "^0.3.2",
"vue-moment": "^4.0.0",
"vue-scrollto": "^2.13.0",
"vue-simple-lightbox": "^1.1.0",
"vue-template-compiler": "^2.5.17",
"vue-the-mask": "^0.11.1",
"vue-toasted": "^1.1.25",
"vue-upload-component": "^2.8.14",
"vue-wysiwyg": "^1.7.2",
"vue2-daterange-picker": "^0.1.1",
"vue2-dropzone": "^3.5.2",
"vue2-editor": "^2.6.1"
}
}
I think the issue is relative to the actual version of Node, that is too new. Could be that? And if so, there's a way to know what version I had installed on my machine at the time I was working on the project for the first time?
Or the issue is a new one?
Now there's the log file:
0 verbose cli /Users/marcellopato/.nvm/versions/node/v16.17.0/bin/node /Users/marcellopato/.nvm/versions/node/v16.17.0/bin/npm
1 info using npm#8.15.0
2 info using node#v16.17.0
3 timing npm:load:whichnode Completed in 0ms
4 timing config:load:defaults Completed in 2ms
5 timing config:load:file:/Users/marcellopato/.nvm/versions/node/v16.17.0/lib/node_modules/npm/npmrc Completed in 1ms
6 timing config:load:builtin Completed in 3ms
7 timing config:load:cli Completed in 3ms
8 timing config:load:env Completed in 0ms
9 timing config:load:file:/Users/marcellopato/Documents/Sites/webroker/.npmrc Completed in 0ms
10 timing config:load:project Completed in 19ms
11 timing config:load:file:/Users/marcellopato/.npmrc Completed in 0ms
12 timing config:load:user Completed in 0ms
13 timing config:load:file:/Users/marcellopato/.nvm/versions/node/v16.17.0/etc/npmrc Completed in 0ms
14 timing config:load:global Completed in 0ms
15 timing config:load:validate Completed in 0ms
16 timing config:load:credentials Completed in 1ms
17 timing config:load:setEnvs Completed in 2ms
18 timing config:load Completed in 33ms
19 timing npm:load:configload Completed in 33ms
20 timing npm:load:mkdirpcache Completed in 1ms
21 timing npm:load:mkdirplogs Completed in 1ms
22 verbose title npm install
23 verbose argv "install"
24 timing npm:load:setTitle Completed in 29ms
25 timing config:load:flatten Completed in 7ms
26 timing npm:load:display Completed in 11ms
27 verbose logfile logs-max:10 dir:/Users/marcellopato/.npm/_logs
28 verbose logfile /Users/marcellopato/.npm/_logs/2022-09-08T23_11_39_339Z-debug-0.log
29 timing npm:load:logFile Completed in 7ms
30 timing npm:load:timers Completed in 0ms
31 timing npm:load:configScope Completed in 0ms
32 timing npm:load Completed in 82ms
33 timing arborist:ctor Completed in 1ms
34 silly logfile start cleaning logs, removing 18 files
35 timing idealTree:init Completed in 1856ms
36 warn old lockfile
36 warn old lockfile The package-lock.json file was created with an old version of npm,
36 warn old lockfile so supplemental metadata must be fetched from the registry.
36 warn old lockfile so supplemental metadata must be fetched from the registry.
36 warn old lockfile
36 warn old lockfile This is a one-time fix-up, please be patient...
36 warn old lockfile
37 silly inflate node_modules/#tinymce/tinymce-vue
38 silly inflate node_modules/#types/node
39 silly inflate node_modules/#types/semver
40 silly inflate node_modules/#websanova/vue-upload
41 silly logfile done cleaning log files
42 http fetch GET 200 https://registry.npmjs.org/#types%2fsemver 414ms (cache revalidated)
43 silly inflate node_modules/abbrev
44 http fetch GET 200 https://registry.npmjs.org/npm 2310ms (cache revalidated)
45 http fetch GET 200 https://registry.npmjs.org/abbrev 155ms (cache revalidated)
46 silly inflate node_modules/accepts
47 http fetch GET 200 https://registry.npmjs.org/#types%2fnode 579ms (cache updated)
48 silly inflate node_modules/acorn
49 http fetch GET 200 https://registry.npmjs.org/accepts 84ms (cache revalidated)
50 silly inflate node_modules/acorn-dynamic-import
51 http fetch GET 200 https://registry.npmjs.org/acorn 73ms (cache revalidated)
52 silly inflate node_modules/acorn-dynamic-import/node_modules/acorn
53 silly inflate node_modules/adjust-sourcemap-loader
54 http fetch GET 200 https://registry.npmjs.org/adjust-sourcemap-loader 62ms (cache revalidated)
55 silly inflate node_modules/adjust-sourcemap-loader/node_modules/camelcase
56 http fetch GET 200 https://registry.npmjs.org/camelcase 82ms (cache revalidated)
57 silly inflate node_modules/adjust-sourcemap-loader/node_modules/lodash.defaults
58 http fetch GET 200 https://registry.npmjs.org/lodash.defaults 59ms (cache revalidated)
59 silly inflate node_modules/adjust-sourcemap-loader/node_modules/lodash.defaults/node_modules/lodash.assign
60 http fetch GET 200 https://registry.npmjs.org/lodash.assign 63ms (cache revalidated)
61 silly inflate node_modules/ajv
62 http fetch GET 200 https://registry.npmjs.org/acorn-dynamic-import 328ms (cache revalidated)
63 silly inflate node_modules/ajv-keywords
64 http fetch GET 200 https://registry.npmjs.org/ajv 54ms (cache revalidated)
65 silly inflate node_modules/align-text
66 http fetch GET 200 https://registry.npmjs.org/ajv-keywords 51ms (cache revalidated)
67 silly inflate node_modules/align-text/node_modules/kind-of
68 http fetch GET 200 https://registry.npmjs.org/kind-of 48ms (cache revalidated)
69 silly inflate node_modules/alphanum-sort
70 http fetch GET 200 https://registry.npmjs.org/alphanum-sort 66ms (cache revalidated)
71 silly inflate node_modules/amdefine
72 http fetch GET 200 https://registry.npmjs.org/#tinymce%2ftinymce-vue 1189ms (cache revalidated)
73 silly inflate node_modules/ansi-html
74 http fetch GET 200 https://registry.npmjs.org/#websanova%2fvue-upload 1200ms (cache revalidated)
75 silly inflate node_modules/ansi-regex
76 http fetch GET 200 https://registry.npmjs.org/amdefine 48ms (cache revalidated)
77 silly inflate node_modules/ansi-styles
78 http fetch GET 200 https://registry.npmjs.org/ansi-html 54ms (cache revalidated)
79 silly inflate node_modules/anymatch
80 http fetch GET 200 https://registry.npmjs.org/ansi-regex 50ms (cache revalidated)
81 silly inflate node_modules/aproba
82 http fetch GET 200 https://registry.npmjs.org/ansi-styles 62ms (cache revalidated)
83 silly inflate node_modules/are-we-there-yet
84 http fetch GET 200 https://registry.npmjs.org/align-text 274ms (cache revalidated)
85 silly inflate node_modules/argparse
86 http fetch GET 200 https://registry.npmjs.org/anymatch 55ms (cache revalidated)
87 silly inflate node_modules/arr-diff
88 http fetch GET 200 https://registry.npmjs.org/aproba 52ms (cache revalidated)
89 silly inflate node_modules/arr-flatten
90 http fetch GET 200 https://registry.npmjs.org/are-we-there-yet 79ms (cache revalidated)
91 silly inflate node_modules/arr-union
92 http fetch GET 200 https://registry.npmjs.org/argparse 70ms (cache revalidated)
93 silly inflate node_modules/array-find-index
94 http fetch GET 200 https://registry.npmjs.org/arr-diff 66ms (cache revalidated)
95 silly inflate node_modules/array-flatten
96 http fetch GET 200 https://registry.npmjs.org/arr-flatten 66ms (cache revalidated)
97 silly inflate node_modules/array-includes
98 http fetch GET 200 https://registry.npmjs.org/array-find-index 77ms (cache revalidated)
99 silly inflate node_modules/array-union
100 http fetch GET 200 https://registry.npmjs.org/array-flatten 73ms (cache revalidated)
101 silly inflate node_modules/array-uniq
102 http fetch GET 200 https://registry.npmjs.org/arr-union 102ms (cache revalidated)
103 silly inflate node_modules/array-unique
104 http fetch GET 200 https://registry.npmjs.org/array-includes 90ms (cache revalidated)
105 silly inflate node_modules/asn1
106 http fetch GET 200 https://registry.npmjs.org/array-union 108ms (cache revalidated)
107 silly inflate node_modules/asn1.js
108 http fetch GET 200 https://registry.npmjs.org/array-uniq 106ms (cache revalidated)
109 silly inflate node_modules/assert
110 http fetch GET 200 https://registry.npmjs.org/array-unique 93ms (cache revalidated)
Probably your current npm is incompatible with the node version.
I advise you to reinstall npm and then install the node again.
Delete npm
Mac:
sudo npm uninstall -g npm
Windows:
npm uninstall -g npm
Install node.js
https://nodejs.org
I'm trying to configure better-docs with component plugin using their official tutorial from github
For some reason I'm receiving a weird error.
Parsing D:\Projects\train-time\src\stories\StoryContainer.tsx ...
Generating output files...
Generating entry file for "components" plugin
Bundling components
running: NODE_ENV=development parcel build docs\entry.js --out-dir docs\build
'NODE_ENV' is not recognized as an internal or external command,
operable program or batch file.
D:\Projects\train-time\node_modules\better-docs\bundler.js:91
throw error
^
Error: Command failed: NODE_ENV=development parcel build docs\entry.js --out-dir docs\build
'NODE_ENV' is not recognized as an internal or external command,
operable program or batch file.
at checkExecSyncError (child_process.js:630:11)
at execSync (child_process.js:666:15)
at bundle (D:\Projects\train-time\node_modules\better-docs\bundler.js:86:5)
at Object.exports.publish (D:\Projects\train-time\node_modules\better-docs\publish.js:699:3)
at Object.module.exports.cli.generateDocs (D:\Projects\train-time\node_modules\jsdoc\cli.js:441:39)
at Object.module.exports.cli.processParseResults (D:\Projects\train-time\node_modules\jsdoc\cli.js:392:24)
at module.exports.cli.main (D:\Projects\train-time\node_modules\jsdoc\cli.js:235:18)
at Object.module.exports.cli.runCommand (D:\Projects\train-time\node_modules\jsdoc\cli.js:186:9)
at D:\Projects\train-time\node_modules\jsdoc\jsdoc.js:93:9
at Object.<anonymous> (D:\Projects\train-time\node_modules\jsdoc\jsdoc.js:94:3)
at Module._compile (internal/modules/cjs/loader.js:1138:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
at Module.load (internal/modules/cjs/loader.js:986:32)
at Function.Module._load (internal/modules/cjs/loader.js:879:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47 {
status: 1,
signal: null,
output: [
null,
<Buffer >,
<Buffer 27 4e 4f 44 45 5f 45 4e 56 27 20 69 73 20 6e 6f 74 20 72 65 63 6f 67 6e 69 7a 65 64 20 61 73 20 61 6e 20 69 6e 74 65 72 6e 61 6c 20 6f 72 20 65 78 74 ... 49 more bytes>
],
pid: 2928,
stdout: <Buffer >,
stderr: <Buffer 27 4e 4f 44 45 5f 45 4e 56 27 20 69 73 20 6e 6f 74 20 72 65 63 6f 67 6e 69 7a 65 64 20 61 73 20 61 6e 20 69 6e 74 65 72 6e 61 6c 20 6f 72 20 65 78 74 ... 49 more bytes>
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! train-time.com#1.0.0 doc: `jsdoc -c jsdoc.json`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the train-time.com#1.0.0 doc script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Does anyone know what does it mean this error and where is from the NODE_ENV? I'm not using any NODE_ENV in the project
The creators of that script assumed you were using a sh-like shell like bash or zsh; the Windows shell is decidedly not compatible with setting environment variables in this way.
I'd recommend installing cross-env as a dev dependency. That lets you set environment variables in a cross-platform way that resembles the sh-like pattern of setting variables. For example, in a package.json script:
"build": "cross-env NODE_ENV=development parcel build docs\entry.js --out-dir docs\build"
newbie here. I had recently switched over to Visual Studio Code to work with Brain.js but when I go to install it into the terminal (With NPM), I get an Error. I have tried multiple other solutions but none work. Any help would be appreciated. Thanx in advance =>
Since I am new also at Linux, I had tried a few variations of install commands(like sudo) and tried to complete the Brain.js installation on Default Linux terminal but to no avail :( . Also a weird thing is that I was able to download BrainJS(Older lib.) but not Brain.js
Even though i don't think there is any problem with the code, Here is it anyways.
const brain = require("brainjs");
let net = new brain.NeuralNetwork({ hiddenLayers: [3] }); //
Setting up neural network
const restaurants = { // Dataset
"KFC":"Monday",
"Item no.1":"Tuesday",
"Vaango":"Wednesday",
"Taco Bell":"Thursday",
"carls Jr.":"Friday",
"":"Saturday",
"Burger King":"Sunday"
}
const TrainingData = [];
for (let restaurantName in restaurants) {
const dayOfWeek = restaurants[restaurantName];
TrainingData.push({
input: { [dayOfWeek]: 1 },
output: { [restaurantName]: 1 }
});
}
const stats = net.train(TrainingData);
THIS IS THE ERROR MSG I AM GETTING:
npm ERR! Linux 5.0.0-23-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "brain.js"
npm ERR! node v8.10.0
npm ERR! npm v3.5.2
npm ERR! code EMISSINGARG
npm ERR! typeerror Error: Missing required argument #1
npm ERR! typeerror at andLogAndFinish (/usr/share/npm/lib/fetch-
package-metadata.js:31:3)
npm ERR! typeerror at fetchPackageMetadata
(/usr/share/npm/lib/fetch-package-metadata.js:51:22)
npm ERR! typeerror at resolveWithNewModule
(/usr/share/npm/lib/install/deps.js:456:12)
npm ERR! typeerror at /usr/share/npm/lib/install/deps.js:190:5
npm ERR! typeerror at
/usr/share/npm/node_modules/slide/lib/async-map.js:52:35
npm ERR! typeerror at Array.forEach (<anonymous>)
npm ERR! typeerror at
/usr/share/npm/node_modules/slide/lib/async-map.js:52:11
npm ERR! typeerror at Array.forEach (<anonymous>)
npm ERR! typeerror at asyncMap
(/usr/share/npm/node_modules/slide/lib/async-map.js:51:8)
npm ERR! typeerror at exports.loadRequestedDeps (/usr/share/npm/lib/install/deps.js:188:3)
npm ERR! typeerror This is an error with npm itself. Please report this error at:
npm ERR! typeerror <http://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! /home/neel/Documents/VS-Code_Projects/npm-debug.log
AND THE DEBUG LOG:--
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'install', 'brain.js' ]
2 info using npm#3.5.2
3 info using node#v8.10.0
4 verbose config Skipping project config: /home/neel/.npmrc. (matches userconfig)
5 silly loadCurrentTree Starting
6 silly install loadCurrentTree
7 silly install readLocalPackageData
8 silly fetchPackageMetaData brain.js
9 silly fetchNamedPackageData brain.js
10 silly mapToRegistry name brain.js
11 silly mapToRegistry using default registry
12 silly mapToRegistry registry https://registry.npmjs.org/
13 silly mapToRegistry uri https://registry.npmjs.org/brain.js
14 verbose request uri https://registry.npmjs.org/brain.js
15 verbose request no auth needed
16 info attempt registry request try #1 at 21:59:12
17 verbose request id 74a22560d1b7c23a
18 verbose etag W/"9fb16e14a6b8c1d1ef1c110acba9db6b"
19 verbose lastModified Fri, 09 Aug 2019 11:09:50 GMT
20 http request GET https://registry.npmjs.org/brain.js
21 http 304 https://registry.npmjs.org/brain.js
22 verbose headers { date: 'Tue, 13 Aug 2019 16:29:14 GMT',
22 verbose headers connection: 'keep-alive',
22 verbose headers 'set-cookie':
22 verbose headers [ '__cfduid=d4bf1b2abca3b24131a1907349098099d1565713753; expires=Wed, 12-Aug-20 16:29:13 GMT; path=/; domain=.npmjs.org; HttpOnly' ],
22 verbose headers 'cf-cache-status': 'REVALIDATED',
22 verbose headers 'cache-control': 'max-age=300',
22 verbose headers 'cf-ray': '505c110c8bc58a5f-BOM',
22 verbose headers etag: '"9fb16e14a6b8c1d1ef1c110acba9db6b"',
22 verbose headers 'expect-ct': 'max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"',
22 verbose headers 'last-modified': 'Fri, 09 Aug 2019 11:09:50 GMT',
22 verbose headers vary: 'accept-encoding, accept',
22 verbose headers 'x-amz-meta-rev': '67-25f3ef5cf61222403c910fbd6b789aa9',
22 verbose headers server: 'cloudflare' }
23 silly get cb [ 304,
23 silly get { date: 'Tue, 13 Aug 2019 16:29:14 GMT',
23 silly get connection: 'keep-alive',
23 silly get 'set-cookie':
23 silly get [ '__cfduid=d4bf1b2abca3b24131a1907349098099d1565713753; expires=Wed, 12-Aug-20 16:29:13 GMT; path=/; domain=.npmjs.org; HttpOnly' ],
23 silly get 'cf-cache-status': 'REVALIDATED',
23 silly get 'cache-control': 'max-age=300',
23 silly get 'cf-ray': '505c110c8bc58a5f-BOM',
23 silly get etag: '"9fb16e14a6b8c1d1ef1c110acba9db6b"',
23 silly get 'expect-ct': 'max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"',
23 silly get 'last-modified': 'Fri, 09 Aug 2019 11:09:50 GMT',
23 silly get vary: 'accept-encoding, accept',
23 silly get 'x-amz-meta-rev': '67-25f3ef5cf61222403c910fbd6b789aa9',
23 silly get server: 'cloudflare' } ]
24 verbose etag https://registry.npmjs.org/brain.js from cache
25 verbose get saving brain.js to /home/neel/.npm/registry.npmjs.org/brain.js/.cache.json
26 silly install normalizeTree
27 silly loadCurrentTree Finishing
28 silly loadIdealTree Starting
29 silly install loadIdealTree
30 silly cloneCurrentTree Starting
31 silly install cloneCurrentTreeToIdealTree
32 silly cloneCurrentTree Finishing
33 silly loadShrinkwrap Starting
34 silly install loadShrinkwrap
35 silly loadShrinkwrap Finishing
36 silly loadAllDepsIntoIdealTree Starting
37 silly install loadAllDepsIntoIdealTree
38 verbose stack Error: Missing required argument #1
38 verbose stack at andLogAndFinish (/usr/share/npm/lib/fetch-package-metadata.js:31:3)
38 verbose stack at fetchPackageMetadata (/usr/share/npm/lib/fetch-package-metadata.js:51:22)
38 verbose stack at resolveWithNewModule (/usr/share/npm/lib/install/deps.js:456:12)
38 verbose stack at /usr/share/npm/lib/install/deps.js:190:5
38 verbose stack at /usr/share/npm/node_modules/slide/lib/async-map.js:52:35
38 verbose stack at Array.forEach (<anonymous>)
38 verbose stack at /usr/share/npm/node_modules/slide/lib/async-map.js:52:11
38 verbose stack at Array.forEach (<anonymous>)
38 verbose stack at asyncMap (/usr/share/npm/node_modules/slide/lib/async-map.js:51:8)
38 verbose stack at exports.loadRequestedDeps (/usr/share/npm/lib/install/deps.js:188:3)
39 verbose cwd /home/neel/Documents/VS-Code_Projects
40 error Linux 5.0.0-23-generic
41 error argv "/usr/bin/node" "/usr/bin/npm" "install" "brain.js"
42 error node v8.10.0
43 error npm v3.5.2
44 error code EMISSINGARG
45 error typeerror Error: Missing required argument #1
45 error typeerror at andLogAndFinish (/usr/share/npm/lib/fetch-package-metadata.js:31:3)
45 error typeerror at fetchPackageMetadata (/usr/share/npm/lib/fetch-package-metadata.js:51:22)
45 error typeerror at resolveWithNewModule (/usr/share/npm/lib/install/deps.js:456:12)
45 error typeerror at /usr/share/npm/lib/install/deps.js:190:5
45 error typeerror at /usr/share/npm/node_modules/slide/lib/async-map.js:52:35
45 error typeerror at Array.forEach (<anonymous>)
45 error typeerror at /usr/share/npm/node_modules/slide/lib/async-map.js:52:11
45 error typeerror at Array.forEach (<anonymous>)
45 error typeerror at asyncMap (/usr/share/npm/node_modules/slide/lib/async-map.js:51:8)
45 error typeerror at exports.loadRequestedDeps (/usr/share/npm/lib/install/deps.js:188:3)
46 error typeerror This is an error with npm itself. Please report this error at:
46 error typeerror <http://github.com/npm/npm/issues>
47 verbose exit [ 1, true ]
You state:
Error installing brain.js
But when you go to install require it, you are using "brainjs", not "brain.js":
const brain = require("brainjs");
You are referencing two different libraries, though different by one character. Use this:
const brain = require('brain.js');
npm ERR! npm v3.5.2
As discussed in the comments, this is an old version of NPM and the solution was to update to a newer version.
trying to install a forked version of ng2-smart-table for my app but npm is not doing it.
I've used
npm install git+http://github.com/myusername/ng2-smart-table.git
npm install git://github.com/myusername/ng2-smart-table.git
npm install github.com/myusername/ng2-smart-table
and many other variations. I get the following error.
npm ERR! addLocal Could not install /tmp/npm-24904-e690204a/git-cache-97763c70/bb5d603024d75ce8a664d949a646ca7c7c29b0a0
npm ERR! Linux 3.10.0-693.5.2.el7.x86_64
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "git://github.com/myusername/ng2-smart-table.git"
npm ERR! node v6.11.1
npm ERR! npm v3.10.10
npm ERR! No version provided in package.json
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! /home/myname/my-app/npm-debug.log
[root#stackc-pre-staging my-app]# vim /home/myname/my-app/npm-debug.log
[root#stackc-pre-staging my-app]# npm install git+http://github.com/myusername/ng2-smart-table.git
npm ERR! addLocal Could not install /tmp/npm-25075-02c22b92/git-cache-ba6c0ee9/bb5d603024d75ce8a664d949a646ca7c7c29b0a0
npm ERR! Linux 3.10.0-693.5.2.el7.x86_64
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "git+http://github.com/myusername/ng2-smart-table.git"
npm ERR! node v6.11.1
npm ERR! npm v3.10.10
npm ERR! No version provided in package.json
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! /home/myname/my-app/npm-debug.log
Contents of /home/myname/my-app/npm-debug.log:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node',
1 verbose cli '/usr/bin/npm',
1 verbose cli 'install',
1 verbose cli 'git+http://github.com/myusername/ng2-smart-table.git' ]
2 info using npm#3.10.10
3 info using node#v6.11.1
4 silly loadCurrentTree Starting
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 silly fetchPackageMetaData git+http://github.com/myusername/ng2-smart-table.git
8 silly fetchOtherPackageData git+http://github.com/myusername/ng2-smart-table.git
9 silly cache add args [ 'git+http://github.com/myusername/ng2-smart-table.git', null ]
10 verbose cache add spec git+http://github.com/myusername/ng2-smart-table.git
11 silly cache add parsed spec Result {
11 silly cache add raw: 'git+http://github.com/myusername/ng2-smart-table.git',
11 silly cache add scope: null,
11 silly cache add escapedName: null,
11 silly cache add name: null,
11 silly cache add rawSpec: 'git+http://github.com/myusername/ng2-smart-table.git',
11 silly cache add spec: 'http://github.com/myusername/ng2-smart-table.git',
11 silly cache add type: 'git' }
12 verbose addRemoteGit caching git+http://github.com/myusername/ng2-smart-table.git
13 silly tryClone cloning git+http://github.com/myusername/ng2-smart-table.git via git+http://github.com/myusername/ng2-smart-table.git
14 verbose tryClone git-http-github-com-myusername-ng2-smart-table-git-6513bc33 not in flight; caching
15 verbose correctMkdir /root/.npm/_git-remotes correctMkdir not in flight; initializing
16 info git [ 'clone',
16 info git '--template=/root/.npm/_git-remotes/_templates',
16 info git '--mirror',
16 info git 'http://github.com/myusername/ng2-smart-table.git',
16 info git '/root/.npm/_git-remotes/git-http-github-com-myusername-ng2-smart-table-git-6513bc33' ]
17 verbose mirrorRemote git+http://github.com/myusername/ng2-smart-table.git git clone http://github.com/myusername/ng2-smart-table.git Cloning into bare repository '/root/.npm/_git-remotes/git-http-github-com-myusername-ng2-smart-table-git-6513bc33'...
18 verbose correctMkdir /root/.npm/_git-remotes correctMkdir not in flight; initializing
19 verbose setPermissions git+http://github.com/myusername/ng2-smart-table.git set permissions on /root/.npm/_git-remotes/git-http-github-com-myusername-ng2-smart-table-git-6513bc33
20 verbose resolveHead git+http://github.com/myusername/ng2-smart-table.git original treeish: master
21 info git [ 'rev-list', '-n1', 'master' ]
22 silly resolveHead git+http://github.com/myusername/ng2-smart-table.git resolved treeish: bb5d603024d75ce8a664d949a646ca7c7c29b0a0
23 verbose resolveHead git+http://github.com/myusername/ng2-smart-table.git resolved Git URL: git+ssh://git#github.com/myusername/ng2-smart-table.git#bb5d603024d75ce8a664d949a646ca7c7c29b0a0
24 silly resolveHead Git working directory: /tmp/npm-25075-02c22b92/git-cache-ba6c0ee9/bb5d603024d75ce8a664d949a646ca7c7c29b0a0
25 info git [ 'clone',
25 info git '/root/.npm/_git-remotes/git-http-github-com-myusername-ng2-smart-table-git-6513bc33',
25 info git '/tmp/npm-25075-02c22b92/git-cache-ba6c0ee9/bb5d603024d75ce8a664d949a646ca7c7c29b0a0' ]
26 verbose cloneResolved git+http://github.com/myusername/ng2-smart-table.git clone Cloning into '/tmp/npm-25075-02c22b92/git-cache-ba6c0ee9/bb5d603024d75ce8a664d949a646ca7c7c29b0a0'...
26 verbose cloneResolved done.
27 info git [ 'checkout', 'bb5d603024d75ce8a664d949a646ca7c7c29b0a0' ]
28 verbose checkoutTreeish git+http://github.com/myusername/ng2-smart-table.git checkout Note: checking out 'bb5d603024d75ce8a664d949a646ca7c7c29b0a0'.
28 verbose checkoutTreeish
28 verbose checkoutTreeish You are in 'detached HEAD' state. You can look around, make experimental
28 verbose checkoutTreeish changes and commit them, and you can discard any commits you make in this
28 verbose checkoutTreeish state without impacting any branches by performing another checkout.
28 verbose checkoutTreeish
28 verbose checkoutTreeish If you want to create a new branch to retain commits you create, you may
28 verbose checkoutTreeish do so (now or later) by using -b with the checkout command again. Example:
28 verbose checkoutTreeish
28 verbose checkoutTreeish git checkout -b new_branch_name
28 verbose checkoutTreeish
28 verbose checkoutTreeish HEAD is now at bb5d603... Added a show/hide variable to column settings so that you can toggle visibility of columns
29 info git [ 'submodule', '-q', 'update', '--init', '--recursive' ]
30 verbose updateSubmodules git+http://github.com/myusername/ng2-smart-table.git submodule update
31 error addLocal Could not install /tmp/npm-25075-02c22b92/git-cache-ba6c0ee9/bb5d603024d75ce8a664d949a646ca7c7c29b0a0
32 silly fetchPackageMetaData Error: No version provided in package.json
32 silly fetchPackageMetaData at /usr/lib/node_modules/npm/lib/cache/add-local.js:73:17
32 silly fetchPackageMetaData at /usr/lib/node_modules/npm/node_modules.bundled/read-package-json/read-json.js:356:5
32 silly fetchPackageMetaData at checkBinReferences_ (/usr/lib/node_modules/npm/node_modules.bundled/read-package-json/read-json.js:320:45)
32 silly fetchPackageMetaData at final (/usr/lib/node_modules/npm/node_modules.bundled/read-package-json/read-json.js:354:3)
32 silly fetchPackageMetaData at then (/usr/lib/node_modules/npm/node_modules.bundled/read-package-json/read-json.js:124:5)
32 silly fetchPackageMetaData at /usr/lib/node_modules/npm/node_modules.bundled/read-package-json/read-json.js:243:12
32 silly fetchPackageMetaData at /usr/lib/node_modules/npm/node_modules.bundled/graceful-fs/graceful-fs.js:78:16
32 silly fetchPackageMetaData at tryToString (fs.js:456:3)
32 silly fetchPackageMetaData at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:443:12)
32 silly fetchPackageMetaData error for git+http://github.com/myusername/ng2-smart-table.git Error: No version provided in package.json
32 silly fetchPackageMetaData at /usr/lib/node_modules/npm/lib/cache/add-local.js:73:17
32 silly fetchPackageMetaData at /usr/lib/node_modules/npm/node_modules.bundled/read-package-json/read-json.js:356:5
32 silly fetchPackageMetaData at checkBinReferences_ (/usr/lib/node_modules/npm/node_modules.bundled/read-package-json/read-json.js:320:45)
32 silly fetchPackageMetaData at final (/usr/lib/node_modules/npm/node_modules.bundled/read-package-json/read-json.js:354:3)
32 silly fetchPackageMetaData at then (/usr/lib/node_modules/npm/node_modules.bundled/read-package-json/read-json.js:124:5)
32 silly fetchPackageMetaData at /usr/lib/node_modules/npm/node_modules.bundled/read-package-json/read-json.js:243:12
32 silly fetchPackageMetaData at /usr/lib/node_modules/npm/node_modules.bundled/graceful-fs/graceful-fs.js:78:16
32 silly fetchPackageMetaData at tryToString (fs.js:456:3)
32 silly fetchPackageMetaData at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:443:12)
33 silly rollbackFailedOptional Starting
34 silly rollbackFailedOptional Finishing
35 silly runTopLevelLifecycles Finishing
36 silly install printInstalled
37 verbose stack Error: No version provided in package.json
37 verbose stack at /usr/lib/node_modules/npm/lib/cache/add-local.js:73:17
37 verbose stack at /usr/lib/node_modules/npm/node_modules.bundled/read-package-json/read-json.js:356:5
37 verbose stack at checkBinReferences_ (/usr/lib/node_modules/npm/node_modules.bundled/read-package-json/read-json.js:320:45)
37 verbose stack at final (/usr/lib/node_modules/npm/node_modules.bundled/read-package-json/read-json.js:354:3)
37 verbose stack at then (/usr/lib/node_modules/npm/node_modules.bundled/read-package-json/read-json.js:124:5)
37 verbose stack at /usr/lib/node_modules/npm/node_modules.bundled/read-package-json/read-json.js:243:12
37 verbose stack at /usr/lib/node_modules/npm/node_modules.bundled/graceful-fs/graceful-fs.js:78:16
37 verbose stack at tryToString (fs.js:456:3)
37 verbose stack at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:443:12)
38 verbose cwd /home/myname/my-app
39 error Linux 3.10.0-693.5.2.el7.x86_64
40 error argv "/usr/bin/node" "/usr/bin/npm" "install" "git+http://github.com/myusername/ng2-smart-table.git"
41 error node v6.11.1
42 error npm v3.10.10
43 error No version provided in package.json
44 error If you need help, you may report this error at:
44 error <https://github.com/npm/npm/issues>
45 verbose exit [ 1, true ]
Is this a permissions issue? Or is there something wrong with the way npm is set up? Any help would be appreciated.
Try recreating package.json for that repo with npm init . command and go through all the steps.
Remember having correct repository link in the repository section.
I had the same problem but above helped.
Problem 1: The repo on your post does not exist.
You might've used the wrong repo url.
Use the correct repo url: https://github.com/akveo/ng2-smart-table
Problem 2: The repo does not have a version specified in the package.json
Just fork it and add a version in the package.json file.
Or, use the npm version,
npm install --save ng2-smart-table
i have node v.0.10.30 and npm 1.4.21 installed,
when i execute this command
npm install express
i get this as a result
Error: shasum check failed for /tmp/npm-4273-g1Rb0gCE/registry.npmjs.org/express/- /express-4.9.7.tgz
npm ERR! Expected: ae3e0bdf0095749467fde125afd77e7988ff0fbb
npm ERR! Actual: da39a3ee5e6b4b0d3255bfef95601890afd80709
npm ERR! From: https://registry.npmjs.org/express/-/express-4.9.7.tgz
npm ERR! at /usr/lib/node_modules/npm/node_modules/sha/index.js:38:8
npm ERR! at ReadStream.<anonymous>(/usr/lib/node_modules/npm/node_modules/sha/index.js:85:7)
npm ERR! at ReadStream.emit (events.js:117:20)
npm ERR! at _stream_readable.js:938:16
npm ERR! at process._tickCallback (node.js:419:13)
more log from npm-debug.log file
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'install', 'express' ]
2 info using npm#1.4.21
3 info using node#v0.10.30
4 verbose node symlink /usr/bin/node
5 warn package.json app#0.0.0 No description
6 warn package.json app#0.0.0 No repository field.
7 warn package.json app#0.0.0 No README data
8 verbose readDependencies using package.json deps
9 verbose cache add [ 'express', null ]
19 verbose lock express# /home/wilson/.npm/64a534c1-express.lock
20 silly addNameRange { name: 'express', range: '*', hasData: false }
21 verbose request where is /express
22 verbose request registry https://registry.npmjs.org/
23 verbose request id a071fcd68daa94eb
24 verbose url raw /express
25 verbose url resolving [ 'https://registry.npmjs.org/', './express' ]
26 verbose url resolved https://registry.npmjs.org/express
27 verbose request where is https://registry.npmjs.org/express
28 info trying registry request attempt 1 at 20:00:01
29 verbose etag "7FVLRT9Y9RQJKGVQC7099FKQ4"
30 http GET https://registry.npmjs.org/express
31 http 304 https://registry.npmjs.org/express
32 silly registry.get cb [ 304,
32 silly registry.get { date: 'Sat, 11 Oct 2014 00:00:01 GMT',
32 silly registry.get server: 'Apache',
32 silly registry.get via: '1.1 varnish',
32 silly registry.get 'last-modified': 'Fri, 10 Oct 2014 23:59:57 GMT',
32 silly registry.get 'cache-control': 'max-age=60',
32 silly registry.get etag: '"7FVLRT9Y9RQJKGVQC7099FKQ4"',
32 silly registry.get 'x-served-by': 'cache-iad2130-IAD',
32 silly registry.get 'x-cache': 'HIT',
32 silly registry.get 'x-cache-hits': '2',
32 silly registry.get 'x-timer': 'S1412985601.881420,VS0,VE0',
32 silly registry.get vary: 'Accept',
32 silly registry.get 'content-length': '0',
32 silly registry.get 'keep-alive': 'timeout=10, max=50',
32 silly registry.get connection: 'Keep-Alive' } ]
33 verbose etag https://registry.npmjs.org/express from cache
34 silly addNameRange number 2 { name: 'express', range: '*', hasData: true }
my os is ubuntu 14.04
npm command recommended me to report this log at npm's github repository
download the file https://registry.npmjs.org/express/-/express-4.9.7.tgz
then install from the file
npm install ./express-4.9.7.tgz
Some of these error messages will typically come up when you are not accessing the root admin of the system while executing the install.
When I opened the terminal and ran $ sudo -i to access the #root and then entered $ npm install express , it was installed correctly. Hopefully this helps!
I had a similar issue which was caused by a corrupt download.
It was easily solved by purging the offending package from the cache and re-running the installation.
$ npm cache clean express
$ npm i express
(in my case the corrupt package was a dependency, so I purged it from cache, and not the package that I was trying to install, of course)
First start command prompt as an administrator then run your command.