error in npm when creating new ember project

What I Wanted to Do

trying to create a new project using Ember

What Happened Instead

Ember ran without problems until it got to the part where it uses npm to install dependencies. then npm crashed.

Ember version:
ember-cli: 3.9.0
node: 10.15.3
os: darwin x64

Reproduction Steps

ember new tracker
installing app
create .editorconfig
create .ember-cli
create .eslintignore
create .eslintrc.js
create .template-lintrc.js
create .travis.yml
create .watchmanconfig
create README.md
create app/app.js
create app/components/.gitkeep
create app/controllers/.gitkeep
create app/helpers/.gitkeep
create app/index.html
create app/models/.gitkeep
create app/resolver.js
create app/router.js
create app/routes/.gitkeep
create app/styles/app.css
create app/templates/application.hbs
create app/templates/components/.gitkeep
create config/environment.js
create config/optional-features.json
create config/targets.js
create ember-cli-build.js
create .gitignore
create package.json
create public/robots.txt
create testem.js
create tests/helpers/.gitkeep
create tests/index.html
create tests/integration/.gitkeep
create tests/test-helper.js
create tests/unit/.gitkeep
create vendor/.gitkeep
Error creating new application. Removing generated directory ./tracker
Command failed: npm install --loglevel error
Unhandled rejection Error: EACCES: permission denied, open β€˜/Users/marden/.npm/_cacache/index-v5/ef/31/d87f2fabe7f98df824bf3a49fa1c0f264d4e38b9e51f8a212e69188e305c’
Unhandled rejection Error: EACCES: permission denied, open β€˜/Users/marden/.npm/_cacache/index-v5/44/81/573d100c94efb972cc18bdc93865c495844f28b8c177ef5859ead70fa44c’
Unhandled rejection Error: EACCES: permission denied, open β€˜/Users/marden/.npm/_cacache/index-v5/ca/b5/3b60e87416ddd08f616097b0e73d08eac0570092dd53f5b2542b947529f1’
npm WARN deprecated exists-sync@0.0.4: Please replace with usage of fs.existsSync
npm WARN deprecated circular-json@0.3.3: CircularJSON is in maintenance only, flatted is its successor.
npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR! https://npm.community

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/marden/.npm/_logs/2019-04-29T15_03_33_686Z-debug.log

Stack Trace and Error Report: /var/folders/p4/q48stmlm8xjb1j0059blx_5r0000gp/T/error.dump.d9187129cc9cce60ca358ede08961890.log

Details

Note that the ember message says:
Command failed: npm install --loglevel error

but if I run β€œnpm install --loglevel error” separately I get no error message. Not sure if this is the actual command that failed, or if it’s something that is generating an error log.

I have uninstalled and reinstalled ember and updated npm to latest, but still get this error.

2019-04-29T15_21_06_055Z-debug.log (176.5 KB)

Platform Info

Mac OS 10.13.6

$ npm --versions
{ npm: β€˜6.9.0’,
ares: β€˜1.15.0’,
cldr: β€˜33.1’,
http_parser: β€˜2.8.0’,
icu: β€˜62.1’,
modules: β€˜64’,
napi: β€˜3’,
nghttp2: β€˜1.34.0’,
node: β€˜10.15.3’,
openssl: β€˜1.1.0j’,
tz: β€˜2018e’,
unicode: β€˜11.0’,
uv: β€˜1.23.2’,
v8: β€˜6.8.275.32-node.51’,
zlib: β€˜1.2.11’ }

$ node -p process.platform
darwin

There is an open issue with installing global packages using sudo leaving behind files with the wrong ownership.

The short version is run this to fix the ownership, then try your creating a project again:


sudo chown -R $(whoami) ~/.npm

The long version and canonical bug is: Global installs (sudo npm i -g) fail on Mac after 6.5 upgrade. Works fine after 6.4.1 downgrade.

Thank you for your quick reply, shadowspawn! This did the trick!

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.