I'm going through an npm tutorial and one command we are learning is npm outdated -g to check if any global packages are out of date.
Whenever I run that command, I get the error:
npm ERR! Cannot read property 'length' of undefined
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/samlegros/.npm/_logs/2019-03-28T00_46_47_834Z-debug.log
I am running npm 6.9.0 and node 10.15.2.
Here is the error log associated with it:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'outdated', '-g' ]
2 info using npm#6.9.0
3 info using node#v10.15.2
4 verbose npm-session bc4abe7eb4488494
5 http fetch GET 304 https://registry.npmjs.org/express-generator 273ms (from cache)
6 silly pacote registry packument for express-generator#^4.16.0 fetched in 284ms
7 http fetch GET 304 https://registry.npmjs.org/http-server 278ms (from cache)
8 http fetch GET 304 https://registry.npmjs.org/text-table 274ms (from cache)
9 silly pacote registry packument for http-server#^0.11.1 fetched in 291ms
10 silly pacote registry packument for text-table#^0.2.0 fetched in 290ms
11 http fetch GET 304 https://registry.npmjs.org/jshint 278ms (from cache)
12 silly pacote registry packument for jshint#^2.10.1 fetched in 292ms
13 http fetch GET 304 https://registry.npmjs.org/node-dev 280ms (from cache)
14 http fetch GET 304 https://registry.npmjs.org/grunt-cli 285ms (from cache)
15 silly pacote registry packument for node-dev#^3.1.3 fetched in 294ms
16 silly pacote registry packument for grunt-cli#^1.3.2 fetched in 295ms
17 http fetch GET 304 https://registry.npmjs.org/create-react-app 289ms (from cache)
18 http fetch GET 304 https://registry.npmjs.org/sequelize-cli 283ms (from cache)
19 silly pacote registry packument for create-react-app#^2.1.8 fetched in 301ms
20-31...
32 silly pacote registry packument for ionic#^3.20.0 fetched in 344ms
33 http fetch GET 304 https://registry.npmjs.org/cordova 350ms (from cache)
34 silly pacote registry packument for cordova#^8.0.0 fetched in 370ms
35 http fetch GET 304 https://registry.npmjs.org/npm 364ms (from cache)
36 silly pacote registry packument for npm#^6.9.0 fetched in 391ms
37 verbose stack TypeError: Cannot read property 'length' of undefined
37 verbose stack at dotindex (/usr/local/lib/node_modules/npm/node_modules/text-table/index.js:59:32)
37 verbose stack at /usr/local/lib/node_modules/npm/node_modules/text-table/index.js:11:21
37 verbose stack at Array.forEach (<anonymous>)
37 verbose stack at forEach (/usr/local/lib/node_modules/npm/node_modules/text-table/index.js:73:31)
37 verbose stack at /usr/local/lib/node_modules/npm/node_modules/text-table/index.js:10:9
37 verbose stack at Array.reduce (<anonymous>)
37 verbose stack at reduce (/usr/local/lib/node_modules/npm/node_modules/text-table/index.js:63:30)
37 verbose stack at module.exports (/usr/local/lib/node_modules/npm/node_modules/text-table/index.js:9:20)
37 verbose stack at /usr/local/lib/node_modules/npm/lib/outdated.js:130:16
37 verbose stack at cb (/usr/local/lib/node_modules/npm/node_modules/slide/lib/async-map.js:47:24)
37 verbose stack at outdated_ (/usr/local/lib/node_modules/npm/lib/outdated.js:221:12)
37 verbose stack at skip (/usr/local/lib/node_modules/npm/lib/outdated.js:343:5)
37 verbose stack at updateDeps (/usr/local/lib/node_modules/npm/lib/outdated.js:446:7)
37 verbose stack at tryCatcher (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
37 verbose stack at Promise.successAdapter [as _fulfillmentHandler0] (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/nodeify.js:23:30)
37 verbose stack at Promise._settlePromise (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:566:21)
38 verbose cwd /Users/samlegros/Documents/Development/Tutorials/lynda-become-a-mern-stack-javascript-developer/learning-npm-the-node-package-manager/exercise-files/CH2/02_01/start
39 verbose Darwin 18.2.0
40 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "outdated" "-g"
41 verbose node v10.15.2
42 verbose npm v6.9.0
43 error Cannot read property 'length' of undefined
44 verbose exit [ 1, true ]
Any help would be deeply appreciated. Thank you.
According to npm-cli on github there was an issue with npm outdated. It was fixed a couple of weeks ago so you likely have to wait until the next update of npm comes out for the fix to be released.
Link: npm outdated fix
Related
I have an Artifactory NPM repo named product_release_npm, with anonymous access disabled.
At the project level, I have an .npmrc file with the following content :
#luciad:registry=https://[DOMAIN]/artifactory/api/npm/product_release_npm/
At the user level, I have an .npmrc file with the following content :
//[DOMAIN]/artifactory/api/npm/product_thirdparty_npm/:_authToken=[AUTH_TOKEN]
//[DOMAIN]/artifactory/api/npm/product_release_npm/:_authToken=[AUTH_TOKEN]
My project's package.json file looks like this :
{
"dependencies": {
"#luciad/ria-core": "^2019.0"
}
}
If I do an npm install with NPM 4.2.0 or lower, I'm able to install this repo succesfully.
If I try the same thing with NPM 5.0.0 or higher, I'm unable to install this repo and get a 404 error.
In some versions of NPM, I'm also getting a 403 error.
Here's the log when try this with NPM 5.6.0, on a Linux machine :
0 info it worked if it ends with ok
1 verbose cli [ '/home/release/nodejs/node-v8.11.1-linux-x64/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'install' ]
2 info using npm#5.6.0
3 info using node#v8.11.1
4 verbose npm-session 63d1960eac6e1e9a
5 silly install runPreinstallTopLevelLifecycles
6 silly preinstall release
7 info lifecycle #~preinstall: #
8 silly install loadCurrentTree
9 silly install readLocalPackageData
10 silly install loadIdealTree
11 silly install cloneCurrentTreeToIdealTree
12 silly install loadShrinkwrap
13 silly install loadAllDepsIntoIdealTree
14 http fetch GET 200 https://[DOMAIN]/artifactory/api/npm/product_release_npm/#luciad%2fria-core 334ms
15 http fetch GET 404 https://[DOMAIN]:443/artifactory/api/npm/product_release_npm/#luciad/ria-core/-/#luciad/ria-core-2019.0.1.tgz 32ms
16 silly fetchPackageMetaData error for #luciad/ria-core#^2019.0 404 Not Found: #luciad/ria-core#^2019.0
17 http fetch GET 404 https://[DOMAIN]:443/artifactory/api/npm/product_release_npm/#luciad/ria-core/-/#luciad/ria-core-2019.0.1.tgz 9ms
18 silly fetchPackageMetaData error for #luciad/ria-core#^2019.0 404 Not Found: #luciad/ria-core#^2019.0
19 silly saveTree release
20 verbose stack Error: 404 Not Found: #luciad/ria-core#^2019.0
20 verbose stack at fetch.then.res (/home/release/nodejs/node-v8.11.1-linux-x64/lib/node_modules/npm/node_modules/pacote/lib/fetchers/registry/fetch.js:42:19)
20 verbose stack at tryCatcher (/home/release/nodejs/node-v8.11.1-linux-x64/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
20 verbose stack at Promise._settlePromiseFromHandler (/home/release/nodejs/node-v8.11.1-linux-x64/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:512:31)
20 verbose stack at Promise._settlePromise (/home/release/nodejs/node-v8.11.1-linux-x64/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:569:18)
20 verbose stack at Promise._settlePromise0 (/home/release/nodejs/node-v8.11.1-linux-x64/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:614:10)
20 verbose stack at Promise._settlePromises (/home/release/nodejs/node-v8.11.1-linux-x64/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:693:18)
20 verbose stack at Async._drainQueue (/home/release/nodejs/node-v8.11.1-linux-x64/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:133:16)
20 verbose stack at Async._drainQueues (/home/release/nodejs/node-v8.11.1-linux-x64/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:143:10)
20 verbose stack at Immediate.Async.drainQueues (/home/release/nodejs/node-v8.11.1-linux-x64/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:17:14)
20 verbose stack at runCallback (timers.js:794:20)
20 verbose stack at tryOnImmediate (timers.js:752:5)
20 verbose stack at processImmediate [as _immediateCallback] (timers.js:729:5)
21 verbose cwd /home/release/Desktop/artifactory/release
22 verbose Linux 4.15.0-65-generic
23 verbose argv "/home/release/nodejs/node-v8.11.1-linux-x64/bin/node" "/usr/local/bin/npm" "install"
24 verbose node v8.11.1
25 verbose npm v5.6.0
26 error code E404
27 error 404 Not Found: #luciad/ria-core#^2019.0
28 verbose exit [ 1, true ]
Here's the log when try this with NPM 6.9.0, on a Windows machine :
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'install' ]
2 info using npm#6.9.0
3 info using node#v10.16.3
4 verbose npm-session e99caa5e8a2881d2
5 silly install runPreinstallTopLevelLifecycles
6 silly preinstall release
7 info lifecycle #~preinstall: #
8 silly install loadCurrentTree
9 silly install readLocalPackageData
10 timing stage:loadCurrentTree Completed in 13ms
11 silly install loadIdealTree
12 silly install cloneCurrentTreeToIdealTree
13 timing stage:loadIdealTree:cloneCurrentTree Completed in 1ms
14 silly install loadShrinkwrap
15 timing stage:loadIdealTree:loadShrinkwrap Completed in 2ms
16 silly install loadAllDepsIntoIdealTree
17 http fetch GET 304 https://[DOMAIN]/artifactory/api/npm/product_release_npm/#luciad%2fria-core 143ms
18 http fetch GET 404 https://[DOMAIN]:443/artifactory/api/npm/product_release_npm/#luciad/ria-core/-/#luciad/ria-core-2019.0.1.tgz 12ms
19 silly fetchPackageMetaData error for #luciad/ria-core#^2019.0 404 Not Found - GET https://[DOMAIN]:443/artifactory/api/npm/product_release_npm/#luciad/ria-core/-/#luciad/ria-core-2019.0.1.tgz
20 http fetch GET 404 https://[DOMAIN]:443/artifactory/api/npm/product_release_npm/#luciad/ria-core/-/#luciad/ria-core-2019.0.1.tgz 10ms
21 silly fetchPackageMetaData error for #luciad/ria-core#^2019.0 404 Not Found - GET https://[DOMAIN]:443/artifactory/api/npm/product_release_npm/#luciad/ria-core/-/#luciad/ria-core-2019.0.1.tgz
22 timing stage:rollbackFailedOptional Completed in 0ms
23 timing stage:runTopLevelLifecycles Completed in 248ms
24 silly saveTree release
25 verbose stack Error: 404 Not Found - GET https://[DOMAIN]:443/artifactory/api/npm/product_release_npm/#luciad/ria-core/-/#luciad/ria-core-2019.0.1.tgz
25 verbose stack at res.buffer.catch.then.body (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-registry-fetch\check-response.js:104:15)
25 verbose stack at process._tickCallback (internal/process/next_tick.js:68:7)
26 verbose statusCode 404
27 verbose pkgid #luciad/ria-core#^2019.0
28 verbose cwd D:\Desktop\EXPERIMENT\artifactory\release
29 verbose Windows_NT 10.0.16299
30 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
31 verbose node v10.16.3
32 verbose npm v6.9.0
33 error code E404
34 error 404 Not Found - GET https://[DOMAIN]:443/artifactory/api/npm/product_release_npm/#luciad/ria-core/-/#luciad/ria-core-2019.0.1.tgz
35 error 404
36 error 404 '#luciad/ria-core#^2019.0' is not in the npm registry.
37 error 404 You should bug the author to publish it (or use the name yourself!)
38 error 404 Note that you can also install from a
39 error 404 tarball, folder, http url, or git url.
40 verbose exit [ 1, true ]
Any idea what might be causing this and/or how to fix this issue?
I am a regular react user and usually use create-react-app but from this morning it is not working.
I have checked the npm, it is installed and fine. I have checked that create-react-app is globally installed on my system. The error is coming with some JSON file.
Versions installed on my system:
node -v
v9.0.0
$ npm -v
5.5.1
I have attached the log file below, I'm attaching log file from where the error comes first:
917 http fetch GET 200 https://registry.npmjs.org/babel-plugin-transform-es2015-unicode-regex 19ms (from cache)
918 silly fetchPackageMetaData error for babel-plugin-transform-es2015-unicode-regex#^6.22.0 Unexpected end of JSON input while parsing near '....7":{"name":"babel-pl'
919 silly pacote range manifest for babel-plugin-transform-es2015-sticky-regex#^6.22.0 fetched in 25ms
920 silly resolveWithNewModule babel-plugin-transform-es2015-sticky-regex#6.24.1 checking installable status
921 silly pacote range manifest for babel-plugin-transform-es2015-template-literals#^6.22.0 fetched in 24ms
922 silly resolveWithNewModule babel-plugin-transform-es2015-template-literals#6.22.0 checking installable status
923 silly pacote range manifest for babel-plugin-transform-exponentiation-operator#^6.22.0 fetched in 23ms
924 silly resolveWithNewModule babel-plugin-transform-exponentiation-operator#6.24.1 checking installable status
925 silly pacote range manifest for babel-plugin-transform-es2015-typeof-symbol#^6.23.0 fetched in 24ms
926 silly resolveWithNewModule babel-plugin-transform-es2015-typeof-symbol#6.23.0 checking installable status
927 verbose stack SyntaxError: Unexpected end of JSON input while parsing near '....7":{"name":"babel-pl'
927 verbose stack at JSON.parse (<anonymous>)
927 verbose stack at parseJson (C:\Program Files\nodejs\node_modules\npm\node_modules\pacote\node_modules\make-fetch-happen\node_modules\node-fetch-npm\node_modules\json-parse-better-errors\index.js:7:17)
927 verbose stack at consumeBody.call.then.buffer (C:\Program Files\nodejs\node_modules\npm\node_modules\pacote\node_modules\make-fetch-happen\node_modules\node-fetch-npm\src\body.js:96:50)
927 verbose stack at <anonymous>
927 verbose stack at process._tickCallback (internal/process/next_tick.js:188:7)
928 verbose cwd C:\Users\ashve\Desktop\Startup\startup
929 verbose Windows_NT 10.0.17134
930 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--save" "--save-exact" "--loglevel" "error" "react" "react-dom" "react-scripts"
931 verbose node v9.0.0
932 verbose npm v5.5.1
933 error Unexpected end of JSON input while parsing near '....7":{"name":"babel-pl'
934 verbose exit [ 1, true ]
I saw you're using Windows. Try to clean the cache.
npm cache clean --force
or
Goto %appdata%\npm-cache and check if the directory is clean or not. If not, delete all file from the directory manually.
Now try create-react-app yourAppName
Im trying to install the node module pocketsphinx, but while installing I get the error:
ERR! OMG ENOENT: no such file or directory, uv_chdir
Of course I do understand what this means, but I have no clue what to do.
If this helps, I'm using:
ubuntu 16.10,
node v8.1.4,
cmake 3.5.2,
npm 5.0.3.
Terminal Output:
jonas#jonas-laptop:~$ sudo npm install -g pocketsphinx
> pocketsphinx#5.0.7 install /usr/local/lib/node_modules/pocketsphinx
> cmake-js compile
info TOOL Using Unix Makefiles generator.
info TOOL Using c++11 compiler standard.
info CMD CONFIGURE
WARN invalid config loglevel="notice"
info REP Build has been failed, trying to do a full rebuild.
info CMD CLEAN
info RUN cmake -E remove_directory "/usr/local/lib/node_modules/pocketsphinx/build"
info CMD CONFIGURE
ERR! OMG ENOENT: no such file or directory, uv_chdir
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! pocketsphinx#5.0.7 install: `cmake-js compile`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the pocketsphinx#5.0.7 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/jonas/.npm/_logs/2017-07-12T19_03_21_852Z-debug.log
jonas#jonas-laptop:~$
And errorlog:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'install',
1 verbose cli '-g',
1 verbose cli 'pocketsphinx' ]
2 info using npm#5.0.3
3 info using node#v8.1.4
4 verbose npm-session 32c7a47cae361b7d
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 http fetch GET 304 https://registry.npmjs.org/pocketsphinx 1028ms (from cache)
8 silly pacote tag manifest for pocketsphinx#latest fetched in 1234ms
9 silly install loadIdealTree
10 silly install cloneCurrentTreeToIdealTree
11 silly install loadShrinkwrap
12 silly install loadAllDepsIntoIdealTree
13 silly resolveWithNewModule pocketsphinx#5.0.7 checking installable status
14 silly currentTree lib
15 silly idealTree lib
15 silly idealTree └── pocketsphinx#5.0.7
16 silly install generateActionsToTake
17 silly diffTrees action count 1
18 silly diffTrees add pocketsphinx#5.0.7
19 silly decomposeActions action count 8
20 silly decomposeActions fetch pocketsphinx#5.0.7
21 silly decomposeActions extract pocketsphinx#5.0.7
22 silly decomposeActions preinstall pocketsphinx#5.0.7
23 silly decomposeActions build pocketsphinx#5.0.7
24 silly decomposeActions install pocketsphinx#5.0.7
25 silly decomposeActions postinstall pocketsphinx#5.0.7
26 silly decomposeActions finalize pocketsphinx#5.0.7
27 silly decomposeActions refresh-package-json pocketsphinx#5.0.7
28 silly install executeActions
29 silly doSerial global-install 8
30 verbose correctMkdir /home/jonas/.npm/_locks correctMkdir not in flight; initializing
31 verbose lock using /home/jonas/.npm/_locks/staging-3a08f0df5026584d.lock for /usr/local/lib/node_modules/.staging
32 silly doParallel extract 8
33 silly extract pocketsphinx#5.0.7
34 silly pacote trying pocketsphinx#https://registry.npmjs.org/pocketsphinx/-/pocketsphinx-5.0.7.tgz by hash: sha1-dUwktQehepSJPiB7kAzI1mRV6EM=
35 silly pacote pocketsphinx#https://registry.npmjs.org/pocketsphinx/-/pocketsphinx-5.0.7.tgz extracted to /usr/local/lib/node_modules/.staging/pocketsphinx-f65a58b7 by content address 90ms
36 silly doReverseSerial remove 8
37 silly doSerial move 8
38 silly doSerial finalize 8
39 silly finalize /usr/local/lib/node_modules/pocketsphinx
40 silly doParallel refresh-package-json 8
41 silly refresh-package-json /usr/local/lib/node_modules/pocketsphinx
42 silly doParallel preinstall 8
43 silly preinstall pocketsphinx#5.0.7
44 info lifecycle pocketsphinx#5.0.7~preinstall: pocketsphinx#5.0.7
45 silly lifecycle pocketsphinx#5.0.7~preinstall: no script for preinstall, continuing
46 silly doSerial build 8
47 silly build pocketsphinx#5.0.7
48 info linkStuff pocketsphinx#5.0.7
49 silly linkStuff pocketsphinx#5.0.7 has /usr/local/lib/node_modules as its parent node_modules
50 silly linkStuff pocketsphinx#5.0.7 is part of a global install
51 silly linkStuff pocketsphinx#5.0.7 is installed into a global node_modules
52 silly linkStuff pocketsphinx#5.0.7 is installed into the top-level global node_modules
53 verbose linkBins pocketsphinx#5.0.7
54 verbose linkMans pocketsphinx#5.0.7
55 silly doSerial global-link 8
56 silly doParallel update-linked 8
57 silly doSerial install 8
58 silly install pocketsphinx#5.0.7
59 info lifecycle pocketsphinx#5.0.7~install: pocketsphinx#5.0.7
60 verbose lifecycle pocketsphinx#5.0.7~install: unsafe-perm in lifecycle false
61 verbose lifecycle pocketsphinx#5.0.7~install: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/usr/local/lib/node_modules/pocketsphinx/node_modules/.bin:/usr/local/lib/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
62 verbose lifecycle pocketsphinx#5.0.7~install: CWD: /usr/local/lib/node_modules/pocketsphinx
63 silly lifecycle pocketsphinx#5.0.7~install: Args: [ '-c', 'cmake-js compile' ]
64 silly lifecycle pocketsphinx#5.0.7~install: Returned: code: 1 signal: null
65 info lifecycle pocketsphinx#5.0.7~install: Failed to exec install script
66 verbose unlock done using /home/jonas/.npm/_locks/staging-3a08f0df5026584d.lock for /usr/local/lib/node_modules/.staging
67 verbose stack Error: pocketsphinx#5.0.7 install: `cmake-js compile`
67 verbose stack Exit status 1
67 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:283:16)
67 verbose stack at emitTwo (events.js:125:13)
67 verbose stack at EventEmitter.emit (events.js:213:7)
67 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:40:14)
67 verbose stack at emitTwo (events.js:125:13)
67 verbose stack at ChildProcess.emit (events.js:213:7)
67 verbose stack at maybeClose (internal/child_process.js:897:16)
67 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:208:5)
68 verbose pkgid pocketsphinx#5.0.7
69 verbose cwd /home/jonas
70 verbose Linux 4.8.0-58-generic
71 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "pocketsphinx"
72 verbose node v8.1.4
73 verbose npm v5.0.3
74 error code ELIFECYCLE
75 error errno 1
76 error pocketsphinx#5.0.7 install: `cmake-js compile`
76 error Exit status 1
77 error Failed at the pocketsphinx#5.0.7 install script.
77 error This is probably not a problem with npm. There is likely additional logging output above.
78 verbose exit [ 1, true ]
Before install, Check any of the node service is running or anything is watching the node_modules folder. In Windows, Visual Studio code, has blocking the installation, once i closed the VS Code, then it installed.
Please refer below:
https://github.com/npm/npm/issues/17444
I'm currently trying to get an existing MEAN application up and running. However, I'm totally struggling with setting up the local environment on my mac.
I didn't create this web-app so that makes things all the more confusing.
SUMMARY
I want to get an existing web-app up and running. I installed node.js and made sure MongoDB was running. I navigated to the /server directory of my app and ran npm install. Then when I tried to run npm start I got an error that something was wrong with the package. I then ran npm bugs <package-name> and it says that <package-name> is not in the npm registry.
DETAILS
npm start gives me this npm-debug.log:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'start' ]
2 info using npm#3.6.0
3 info using node#v5.7.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle groep4#0.0.1~prestart: groep4#0.0.1
6 silly lifecycle groep4#0.0.1~prestart: no script for restart, continuing
7 info lifecycle groep4#0.0.1~start: groep4#0.0.1
8 verbose lifecycle groep4#0.0.1~start: unsafe-perm in lifecycle true
9 verbose lifecycle groep4#0.0.1~start: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/Sander/Documents/game-out/server/node_modules/.bin:/Users/Sander/.rvm/gems/ruby-1.9.3-p392/bin:/Users/Sander/.rvm/gems/ruby-1.9.3-p392#global/bin:/Users/Sander/.rvm/rubies/ruby-1.9.3-p392/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/Sander/.rvm/bin
10 verbose lifecycle groep4#0.0.1~start: CWD: /Users/Sander/Documents/game-out/server
11 silly lifecycle groep4#0.0.1~start: Args: [ '-c', 'node bin/www.js' ]
12 silly lifecycle groep4#0.0.1~start: Returned: code: 1 signal: null
13 info lifecycle groep4#0.0.1~start: Failed to exec start script
14 verbose stack Error: groep4#0.0.1 start: `node bin/www.js`
14 verbose stack Exit status 1
14 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:232:16)
14 verbose stack at emitTwo (events.js:100:13)
14 verbose stack at EventEmitter.emit (events.js:185:7)
14 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:24:14)
14 verbose stack at emitTwo (events.js:100:13)
14 verbose stack at ChildProcess.emit (events.js:185:7)
14 verbose stack at maybeClose (internal/child_process.js:827:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
15 verbose pkgid groep4#0.0.1
16 verbose cwd /Users/Sander/Documents/game-out/server
17 error Darwin 15.3.0
18 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
19 error node v5.7.0
20 error npm v3.6.0
21 error code ELIFECYCLE
22 error groep4#0.0.1 start: `node bin/www.js`
22 error Exit status 1
23 error Failed at the groep4#0.0.1 start script 'node bin/www.js'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the groep4 package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error node bin/www.js
23 error You can get information on how to open an issue for this project with:
23 error npm bugs groep4
23 error Or if that isn't available, you can get their info via:
23 error npm owner ls groep4
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]
npm bugs groep4 gives me the following npm-debug.log:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'bugs', 'groep4' ]
2 info using npm#3.6.0
3 info using node#v5.7.0
4 silly fetchPackageMetaData groep4
5 silly fetchNamedPackageData groep4
6 silly mapToRegistry name groep4
7 silly mapToRegistry using default registry
8 silly mapToRegistry registry https://registry.npmjs.org/
9 silly mapToRegistry uri https://registry.npmjs.org/groep4
10 verbose request uri https://registry.npmjs.org/groep4
11 verbose request no auth needed
12 info attempt registry request try #1 at 10:01:10 PM
13 verbose request using bearer token for auth
14 verbose request id 4a6ce97af77a8f09
15 http request GET https://registry.npmjs.org/groep4
16 http 404 https://registry.npmjs.org/groep4
17 verbose headers { 'content-type': 'application/json',
17 verbose headers 'cache-control': 'max-age=0',
17 verbose headers 'content-length': '2',
17 verbose headers 'accept-ranges': 'bytes',
17 verbose headers date: 'Thu, 25 Feb 2016 21:01:11 GMT',
17 verbose headers via: '1.1 varnish',
17 verbose headers connection: 'keep-alive',
17 verbose headers 'x-served-by': 'cache-ams4146-AMS',
17 verbose headers 'x-cache': 'MISS',
17 verbose headers 'x-cache-hits': '0',
17 verbose headers 'x-timer': 'S1456434071.123107,VS0,VE697' }
18 silly get cb [ 404,
18 silly get { 'content-type': 'application/json',
18 silly get 'cache-control': 'max-age=0',
18 silly get 'content-length': '2',
18 silly get 'accept-ranges': 'bytes',
18 silly get date: 'Thu, 25 Feb 2016 21:01:11 GMT',
18 silly get via: '1.1 varnish',
18 silly get connection: 'keep-alive',
18 silly get 'x-served-by': 'cache-ams4146-AMS',
18 silly get 'x-cache': 'MISS',
18 silly get 'x-cache-hits': '0',
18 silly get 'x-timer': 'S1456434071.123107,VS0,VE697' } ]
19 silly fetchPackageMetaData Error: Registry returned 404 for GET on https://registry.npmjs.org/groep4
19 silly fetchPackageMetaData at makeError (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:264:12)
19 silly fetchPackageMetaData at CachingRegistryClient.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:242:14)
19 silly fetchPackageMetaData at Request._callback (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:172:14)
19 silly fetchPackageMetaData at Request.self.callback (/usr/local/lib/node_modules/npm/node_modules/request/request.js:198:22)
19 silly fetchPackageMetaData at emitTwo (events.js:100:13)
19 silly fetchPackageMetaData at Request.emit (events.js:185:7)
19 silly fetchPackageMetaData at Request.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/request/request.js:1035:10)
19 silly fetchPackageMetaData at emitOne (events.js:95:20)
19 silly fetchPackageMetaData at Request.emit (events.js:182:7)
19 silly fetchPackageMetaData at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/request/request.js:962:12)
19 silly fetchPackageMetaData error for groep4 { [Error: Registry returned 404 for GET on https://registry.npmjs.org/groep4] pkgid: 'groep4', statusCode: 404, code: 'E404' }
20 verbose stack Error: Registry returned 404 for GET on https://registry.npmjs.org/groep4
20 verbose stack at makeError (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:264:12)
20 verbose stack at CachingRegistryClient.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:242:14)
20 verbose stack at Request._callback (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:172:14)
20 verbose stack at Request.self.callback (/usr/local/lib/node_modules/npm/node_modules/request/request.js:198:22)
20 verbose stack at emitTwo (events.js:100:13)
20 verbose stack at Request.emit (events.js:185:7)
20 verbose stack at Request.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/request/request.js:1035:10)
20 verbose stack at emitOne (events.js:95:20)
20 verbose stack at Request.emit (events.js:182:7)
20 verbose stack at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/request/request.js:962:12)
21 verbose statusCode 404
22 verbose pkgid groep4
23 verbose cwd /Users/Sander/Documents/game-out/server
24 error Darwin 15.3.0
25 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "bugs" "groep4"
26 error node v5.7.0
27 error npm v3.6.0
28 error code E404
29 error 404 Registry returned 404 for GET on https://registry.npmjs.org/groep4
30 error 404
31 error 404 'groep4' is not in the npm registry.
32 error 404 You should bug the author to publish it (or use the name yourself!)
33 error 404 Note that you can also install from a
34 error 404 tarball, folder, http url, or git url.
35 verbose exit [ 1, true ]
As a result of this I've been reading tons of stuff about npm and packages. I tried creating a tarball from the package,json and installing that. But nothing came of it. I still got that same error when running npm start.
I've also double checked with someone who worked on this app that https://registry.npmjs.org/groep4 has never existed. So the issue isn't simply that the registry was emptied, which was my initial thought.
I managed to get a fresh MEAN stack application up and running using sudo npm install -g mean-cli and mean init yourNewApp. Then I just followed the on-screen instructions to get everything set up. It worked fine. So I'm assuming that the issue isn't with node.js or MongoDB.
I made the entire thing available via GitHub, perhaps that will give a bit of context.
I supplied every detail I could think of but please don't hesitate to ask for anything you need.
So after a lot of troubleshooting I found the answer. I'll post it here for future reference.
The error was a bit misleading since the package had nothing to do with anything. The problem was actually with the config file. The first step was to set that up correctly.
Additionally, the server should be started with node server.js and NOT npm start.
That fixed it for me. I now have the app up and running in my local environment.
I wanted to install assemble.io but i get only this strange error messages.
I use node version 5.2.0, npm version 3.3.12, grunt 0.4.5. somebody has an idea what im doing wrong?
I install the plugin with this command:
npm install assemble --save-dev
This is the official docu for the installation
http://assemble.io/docs/Installation.html
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "assemble" "--save-dev"
npm ERR! node v5.2.0
npm ERR! npm v3.3.12
npm ERR! code ENOSELF
npm ERR! Refusing to install assemble as a dependency of itself
npm ERR!
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\<my user>\Desktop\assemble test\npm-debug.log
this is the npm-debug.log
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'install',
1 verbose cli 'assemble',
1 verbose cli '--save-dev' ]
2 info using npm#3.3.12
3 info using node#v5.2.0
4 silly loadCurrentTree Starting
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 silly fetchPackageMetaData assemble
8 silly fetchNamedPackageData assemble
9 silly mapToRegistry name assemble
10 silly mapToRegistry using default registry
11 silly mapToRegistry registry https://registry.npmjs.org/
12 silly mapToRegistry uri https://registry.npmjs.org/assemble
13 verbose request uri https://registry.npmjs.org/assemble
14 verbose request no auth needed
15 info attempt registry request try #1 at 11:07:31
16 verbose request id aa14641fec14dacb
17 verbose etag "8IAPJTPQFKJPLI2YBI4NXTZG4"
18 http request GET https://registry.npmjs.org/assemble
19 http 304 https://registry.npmjs.org/assemble
20 verbose headers { date: 'Tue, 12 Jan 2016 10:07:31 GMT',
20 verbose headers via: '1.1 varnish',
20 verbose headers 'cache-control': 'max-age=300',
20 verbose headers etag: '"8IAPJTPQFKJPLI2YBI4NXTZG4"',
20 verbose headers age: '62',
20 verbose headers connection: 'keep-alive',
20 verbose headers 'x-served-by': 'cache-ams4139-AMS',
20 verbose headers 'x-cache': 'HIT',
20 verbose headers 'x-cache-hits': '1',
20 verbose headers 'x-timer': 'S1452593251.405495,VS0,VE1',
20 verbose headers vary: 'Accept' }
21 silly get cb [ 304,
21 silly get { date: 'Tue, 12 Jan 2016 10:07:31 GMT',
21 silly get via: '1.1 varnish',
21 silly get 'cache-control': 'max-age=300',
21 silly get etag: '"8IAPJTPQFKJPLI2YBI4NXTZG4"',
21 silly get age: '62',
21 silly get connection: 'keep-alive',
21 silly get 'x-served-by': 'cache-ams4139-AMS',
21 silly get 'x-cache': 'HIT',
21 silly get 'x-cache-hits': '1',
21 silly get 'x-timer': 'S1452593251.405495,VS0,VE1',
21 silly get vary: 'Accept' } ]
22 verbose etag https://registry.npmjs.org/assemble from cache
23 verbose get saving assemble to C:\Users\<my user>\AppData\Roaming\npm-cache\registry.npmjs.org\assemble\.cache.json
24 silly install normalizeTree
25 silly loadCurrentTree Finishing
26 silly loadIdealTree Starting
27 silly install loadIdealTree
28 silly cloneCurrentTree Starting
29 silly install cloneCurrentTreeToIdealTree
30 silly cloneCurrentTree Finishing
31 silly loadShrinkwrap Starting
32 silly install loadShrinkwrap
33 silly loadShrinkwrap Finishing
34 silly loadAllDepsIntoIdealTree Starting
35 silly install loadAllDepsIntoIdealTree
36 silly rollbackFailedOptional Starting
37 silly rollbackFailedOptional Finishing
38 silly runTopLevelLifecycles Starting
39 silly runTopLevelLifecycles Finishing
40 silly install printInstalled
41 verbose stack Error: Refusing to install assemble as a dependency of itself
41 verbose stack at checkSelf (C:\Program Files\nodejs\node_modules\npm\lib\install\validate-args.js:40:14)
41 verbose stack at Array.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\slide\lib\bind-actor.js:15:8)
41 verbose stack at LOOP (C:\Program Files\nodejs\node_modules\npm\node_modules\slide\lib\chain.js:15:14)
41 verbose stack at chain (C:\Program Files\nodejs\node_modules\npm\node_modules\slide\lib\chain.js:20:5)
41 verbose stack at C:\Program Files\nodejs\node_modules\npm\lib\install\validate-args.js:15:5
41 verbose stack at C:\Program Files\nodejs\node_modules\npm\node_modules\slide\lib\async-map.js:52:35
41 verbose stack at Array.forEach (native)
41 verbose stack at C:\Program Files\nodejs\node_modules\npm\node_modules\slide\lib\async-map.js:52:11
41 verbose stack at Array.forEach (native)
41 verbose stack at asyncMap (C:\Program Files\nodejs\node_modules\npm\node_modules\slide\lib\async-map.js:51:8)
42 verbose cwd C:\Users\<my user>\Desktop\assemble test
43 error Windows_NT 6.3.9600
44 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "assemble" "--save-dev"
45 error node v5.2.0
46 error npm v3.3.12
47 error code ENOSELF
48 error Refusing to install assemble as a dependency of itself
49 error If you need help, you may report this error at:
49 error <https://github.com/npm/npm/issues>
50 verbose exit [ 1, true ]
gregor ;)
Ok i found the problem. The official documentation is out of date. i found the answer there
Major refactor. Assemble was completely re-written from the ground-up as a standalone node.js library and is no longer a grunt plugin. Grunt plugin support has been moved to grunt-assemble. Please see that repo for additional details.
so you have to use
npm install grunt-assemble --save-dev
now, if you like to use assemble with grunt