Reputation: 1585
I'm having problems building a project with MEAN.io. I run through all of the steps given by MEAN.io but I receive the following error:
npm ERR! Cannot read property '0' of undefined
Steps:
sudo npm install -g mean-cli
mean init testapp
error:
Cloning into 'testapp'...
/home/ubuntu/.npm/_locks/npm-eb15ca27eba77bee.lock
/home/ubuntu/.npm/anonymous-cli-metrics.json
There are 3 files in your ~/.npm owned by root
Please change the permissions by running - chown -R `whoami` ~/.npm
/home/ubuntu/.nvm/versions/node/v8.2.1/lib/node_modules/mean-cli/lib/install.js:52
if (err) throw err;
^
ROOT PERMISSIONS IN NPM
sudo chown -R
whoami~/.npm
mean init testapp
message:
Install node package dependencies:
$ cd testapp && npm install
Bower install should be triggered for client side dependencies.
If it did not run invoke it manually...
$ cd testapp && bower install
Run the app by running:
$ cd testapp and then run..
$ gulp
cd testapp && npm install
output:
> [email protected] install /home/ubuntu/workspace/testapp/node_modules/node-sass
> node scripts/install.js
Cached binary found at /home/ubuntu/.npm/node-sass/4.5.3/linux-x64-57_binding.node
> [email protected] postinstall /home/ubuntu/workspace/testapp/node_modules/node-sass
> node scripts/build.js
Binary found at /home/ubuntu/workspace/testapp/node_modules/node-sass/vendor/linux-x64-57/binding.node
Testing binary
Binary is fine
> [email protected] postinstall /home/ubuntu/workspace/testapp
> npm run webdriver:update
> [email protected] webdriver:update /home/ubuntu/workspace/testapp
> webdriver-manager update
[19:17:48] I/file_manager - creating folder /home/ubuntu/workspace/testapp/node_modules/protractor/node_modules/webdriver-manager/selenium
[19:17:49] I/update - chromedriver: unzipping chromedriver_2.31.zip
[19:17:49] I/update - chromedriver: setting permissions to 0755 for /home/ubuntu/workspace/testapp/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.31
[19:17:50] I/update - geckodriver: unzipping geckodriver-v0.18.0.tar.gz
[19:17:50] I/update - geckodriver: setting permissions to 0755 for /home/ubuntu/workspace/testapp/node_modules/protractor/node_modules/webdriver-manager/selenium/geckodriver-v0.18.0
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
error:
[17:50:10] Local gulp not found in ~/workspace/testapp
[17:50:11] Try running: npm install gulp
error:
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN @angular/[email protected] requires a peer of @angular/[email protected] but none was installed.
npm WARN @angular/[email protected] requires a peer of @angular/[email protected] but none was installed.
npm WARN [email protected] requires a peer of zone.js@~0.6.21 but none was installed.
npm WARN [email protected] requires a peer of graphql@^0.6.1 || ^0.7.0 but none was installed.
npm ERR! Cannot read property '0' of undefined
npm ERR! A complete log of this run can be found in:
npm ERR! /home/ubuntu/.npm/_logs/2017-07-26T17_52_19_821Z-debug.log
Here is a bit of output from the log file
2238 verbose unlock done using /home/ubuntu/.npm/_locks/staging-719b6a82c67d40a4.lock for /home/ubuntu/workspace/testapp/node_modules/.staging
2239 warn @angular/[email protected] requires a peer of @angular/[email protected] but none was installed.
2240 warn @angular/[email protected] requires a peer of @angular/[email protected] but none was installed.
2241 warn [email protected] requires a peer of zone.js@~0.6.21 but none was installed.
2242 warn [email protected] requires a peer of graphql@^0.6.1 || ^0.7.0 but none was installed.
2243 verbose stack TypeError: Cannot read property '0' of undefined
2243 verbose stack at rmStuff (/home/ubuntu/.nvm/versions/node/v8.2.1/lib/node_modules/npm/lib/unbuild.js:61:24)
2243 verbose stack at tryCatcher (/home/ubuntu/.nvm/versions/node/v8.2.1/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
2243 verbose stack at ret (eval at makeNodePromisifiedEval (/home/ubuntu/.nvm/versions/node/v8.2.1/lib/node_modules/npm/node_modules/bluebird/js/release/promisify.js:184:12), <anonymous>:13:39)
2243 verbose stack at lifecycle.then.then (/home/ubuntu/.nvm/versions/node/v8.2.1/lib/node_modules/npm/lib/install/action/unbuild.js:12:12)
2243 verbose stack at tryCatcher (/home/ubuntu/.nvm/versions/node/v8.2.1/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
2243 verbose stack at Promise._settlePromiseFromHandler (/home/ubuntu/.nvm/versions/node/v8.2.1/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:512:31)
2243 verbose stack at Promise._settlePromise (/home/ubuntu/.nvm/versions/node/v8.2.1/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:569:18)
2243 verbose stack at Promise._settlePromise0 (/home/ubuntu/.nvm/versions/node/v8.2.1/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:614:10)
2243 verbose stack at Promise._settlePromises (/home/ubuntu/.nvm/versions/node/v8.2.1/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:693:18)
2243 verbose stack at Async._drainQueue (/home/ubuntu/.nvm/versions/node/v8.2.1/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:133:16)
2243 verbose stack at Async._drainQueues (/home/ubuntu/.nvm/versions/node/v8.2.1/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:143:10)
2243 verbose stack at Immediate.Async.drainQueues (/home/ubuntu/.nvm/versions/node/v8.2.1/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:17:14)
2243 verbose stack at runCallback (timers.js:781:20)
2243 verbose stack at tryOnImmediate (timers.js:743:5)
2243 verbose stack at processImmediate [as _immediateCallback] (timers.js:714:5)
2244 verbose cwd /home/ubuntu/workspace/testapp
2245 verbose Linux 4.9.17-c9
2246 verbose argv "/home/ubuntu/.nvm/versions/node/v8.2.1/bin/node" "/home/ubuntu/.nvm/versions/node/v8.2.1/bin/npm" "install" "gulp"
2247 verbose node v8.2.1
2248 verbose npm v5.3.0
2249 error Cannot read property '0' of undefined
2250 verbose exit [ 1, true ]
Any idea what went wrong?
Upvotes: -1
Views: 104
Reputation: 4539
It is the problem with [email protected]
. Try downgrading the npm by following command and npm install again.
npm install -g [email protected]
Upvotes: 0