简体   繁体   English

找不到模块“节点”

[英]Cannot find module 'node'

I'm trying to run a test script through package.json,我正在尝试通过 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.我使用 Windows 10 安装了节点 10.16.2。

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这就是在我们的一个项目中对我的队友有用的方法

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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