Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm install of nyc@12 fails on Node.js 6 #852

Closed
JustinBeckwith opened this issue Jun 1, 2018 · 8 comments
Closed

npm install of nyc@12 fails on Node.js 6 #852

JustinBeckwith opened this issue Jun 1, 2018 · 8 comments

Comments

@JustinBeckwith
Copy link

With the latest version of nyc, npm install is failing with node.js 6. To reproduce:

nvm use 6
mkdir testy && cd testy
npm init -y
npm install nyc

That results in this error :/

beckwith-macbookpro:babel-bug beckwith$ npm install
[email protected] /Users/beckwith/Code/babel-bug
└── (empty)

npm WARN [email protected] No description
npm WARN [email protected] No repository field.
npm ERR! Darwin 17.5.0
npm ERR! argv "/Users/beckwith/.nvm/versions/node/v6.10.2/bin/node" "/Users/beckwith/.nvm/versions/node/v6.10.2/bin/npm" "install"
npm ERR! node v6.10.2
npm ERR! npm  v3.10.10
npm ERR! path /Users/beckwith/Code/babel-bug/node_modules/.staging/@babel/parser-17c5b876
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename

npm ERR! enoent ENOENT: no such file or directory, rename '/Users/beckwith/Code/babel-bug/node_modules/.staging/@babel/parser-17c5b876' -> '/Users/beckwith/Code/babel-bug/node_modules/nyc/node_modules/@babel/parser'
npm ERR! enoent ENOENT: no such file or directory, rename '/Users/beckwith/Code/babel-bug/node_modules/.staging/@babel/parser-17c5b876' -> '/Users/beckwith/Code/babel-bug/node_modules/nyc/node_modules/@babel/parser'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/beckwith/Code/babel-bug/npm-debug.log
npm ERR! code 1

My package.json in case it's helpful:

{
  "name": "babel-bug",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "nyc": "^12.0.1"
  }
}

I'm seeing this both on my local machine as well as CIrcleCI, so it's probably not an environmental thing?

@JustinBeckwith
Copy link
Author

Also, I can confirm that backing off to 11.9.0 fixes the issue.

@JustinBeckwith JustinBeckwith changed the title npm install fails on Node.js 6 npm install of nyc@12 fails on Node.js 6 Jun 1, 2018
@jcane86
Copy link

jcane86 commented Jun 2, 2018

Having the same problem in my project that has nyc as a dependency.

CI builds on travis are failing for node v5, v6 & v7.

working fine with nyc 11.9.0

@Apollon77
Copy link

Apollon77 commented Jun 2, 2018

Can confirm, same probem for multiple projects. Also 12.0.1 did not fixed it

@coreyfarrell
Copy link
Member

It appears that use of bundledDependencies may be exposing an issue in [email protected].

I did a local test where I removed all bundledDependencies from package.json, I ran npm pack. This created ./nyc-12.0.1.tgz which did not contain a node_modules directory. I then pointed my test project dependency to the tarball instead of ^12.0.1, ran npm install with node 6. No errors this time.

sverweij added a commit to sverweij/dependency-cruiser that referenced this issue Jun 2, 2018
sverweij added a commit to sverweij/dependency-cruiser that referenced this issue Jun 2, 2018
…le node 6 builds on gitlab & travis

... until istanbuljs/nyc#852 is resolved
@bcoe
Copy link
Member

bcoe commented Jun 3, 2018

@Apollon77 @JustinBeckwith @jcane86, et. al. this should now be addressed in 12.0.2; I've stopped bundling istanbul-lib-instrument specifically, which seemed to be the module causing issues for [email protected].

@sverweij
Copy link

sverweij commented Jun 4, 2018

@bcoe just tried on two packages the fix works ✅ - thanks for the super quick response!

@Apollon77
Copy link

Confirmed too. 12.0.2 fixes the issue

@jcane86
Copy link

jcane86 commented Jun 4, 2018

@bcoe thaks for a quick fix!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants