node.js - 找不到模块 './Gulp'

标签 node.js npm webpack gulp

当我尝试运行 npm start 时收到此错误:

module.js:545
throw err;
^

Error: Cannot find module './Gulp'
at Function.Module._resolveFilename (module.js:543:15)
at Function.Module._load (module.js:470:25)
at Module.require (module.js:593:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/var/www/html/xocolatl/xocolatl/barrel/barrel-shopify/node_modules/@barrelny/cli/lib/builder.js:6:14)
at Module._compile (module.js:649:30)
at Object.Module._extensions..js (module.js:660:10)
at Module.load (module.js:561:32)
at tryModuleLoad (module.js:501:12)
at Function.Module._load (module.js:493:3)

在此之前我已经运行过 npm install,并且已经在全局和本地安装了 gulp。

Node version: 9.8.0
Npm version: 6.5.0
Gulp versions:
[20:47:56] CLI version 2.0.1
[20:47:56] Local version 4.0.0

我不确定为什么会收到此错误。我尝试删除 node_modules 并再次运行 npm install,但这没有帮助。

最佳答案

看来您在当前目录中调用了 gulp 包。消除 。/ 这样,nodejs将在node_modules中搜索包,而不是在当前目录中。

关于node.js - 找不到模块 './Gulp',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53957824/

相关文章:

node.js - 在 Mongoose Schema 中使用多个值的唯一文档

node.js - 'This' 在 typescript 中未定义,即使在 promise 中使用箭头函数

django - Heroku:为 Django 应用运行 npm install 和 gulp build

javascript - 安装后如何运行 Karma?

javascript - Webpack 4 和 splitChunks - 将所有 vendor 代码移至单独的 block (动态导入的模块除外)

angular - Webpack Module Federation Unsatisfied version 11.x.x of shared singleton module @angular/common (required ^7.2.0)

javascript - 当在 app.listen(PORT, HOST) 中设置 HOST 时,为什么 app.address() 为空?

javascript - 在 ES6 Node.js 中,如何让一个类随处可用?

reactjs - 如何使 React 在整个应用程序上可用,而无需在每个 jsx 文件中一次又一次地导入它

ssl - TSD 错误 : self signed certificate in certificate chain