【问题标题】:Cannot start npm无法启动 npm
【发布时间】:2016-12-20 09:06:13
【问题描述】:

我在这里安装了种子应用程序:https://github.com/moizKachwala/Angular2-expressjs-mongoose-gulp-node-typescript 我正在尝试运行 npm start 但未创建和启动服务器。

我认为这行“(node:16596) fs: re-evalating native module sources is not supported. 如果您使用的是 graceful-fs 模块,请将其更新到更新的版本”是问题所在,我发现在 SO 上建议确保您拥有我所做的最新 npm。

注意:gulp 脚本应该创建 dist 文件夹,它将放置所有 js 文件,但没有创建 dist 文件夹,因此 gulp 脚本在某处失败...

还能是什么?

c:\work\angular\pricecompare1>npm start

> angular2-express@1.0.0 start c:\work\angular\pricecompare1
> concurrent --kill-others "gulp watch" "gulp start"

[1] [09:35:54]
[0] [09:35:54] Requiring external module ts-node/register
[1] Requiring external module ts-node/register
[0] (node:16596) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
[1] (node:17124) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
[0] [09:35:55]
[0] Using gulpfile c:\work\angular\pricecompare1\gulpfile.ts
[1] [09:35:55] Using gulpfile c:\work\angular\pricecompare1\gulpfile.ts
[0] [09:35:55]
[0] Starting 'watch'...
[1] [09:35:55]
[1] Starting 'start'...
[1] [09:35:55]
[1] Finished 'start' after 1.88 ms
[1] [09:35:55] [nodemon] 1.10.0
[1] [09:35:55] [nodemon] to restart at any time, enter `rs`
[1] [09:35:55] [nodemon] watching: *.*
[1] [09:35:55] [nodemon] starting `node dist/server/server.js`
[0] [09:35:55] Finished 'watch' after 32 ms
[1] module.js:442
[1]     throw err;
[1]     ^
[1]
[1] Error: Cannot find module 'c:\work\angular\pricecompare1\dist\server\server.js'
[1]     at Function.Module._resolveFilename (module.js:440:15)
[1]     at Function.Module._load (module.js:388:25)
[1]     at Module.runMain (module.js:575:10)
[1]     at run (bootstrap_node.js:352:7)
[1]     at startup (bootstrap_node.js:144:9)
[1]     at bootstrap_node.js:467:3
[1] [09:35:55] [nodemon] app crashed - waiting for file changes before starting...

【问题讨论】:

  • 看起来错误是因为找不到您的 server.js 而引发的。我会确保文件映射正确。

标签: node.js angular gulp


【解决方案1】:

在您的 package.json 文件中找到启动命令并使用正确的目录引用您的 server.js

pricecompare1\dist\server\server.js

【讨论】:

  • gulp 脚本应该创建 dist 文件夹,它将放置所有 js 文件
猜你喜欢
  • 2019-04-13
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-03-20
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多