简体   繁体   中英

Cannot find module 'node'

I'm trying to run a test script through package.json,

"test": "cross-env NODE_ENV=test nyc mocha --recursive --compilers js:babel-register --require babel-polyfill",

and on running I get the following error:

internal/modules/cjs/loader.js:638
    throw err;
    ^

Error: Cannot find module 'C:\Users\aw030085\Desktop\github\diabetesdashboard\node'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)

I have a coworker who can run it just fine, but he's not sure if he has anything extra installed. I'm not sure why it's throwing an error.

I have node 10.16.2 installed, using Windows 10.

You can run this

npm uninstall nyc
npm i --save-dev nyc

A bit late to the party but if anyone has that problem, try lowering your node version. This is what worked for my teammate in one of our projects

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM