命令 `npm start` 什么都不做 [英] Command `npm start` does nothing

查看:57
本文介绍了命令 `npm start` 什么都不做的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的 Node 项目目录中输入 npm start 后,我看到了旋转管道符号,表明 npm 正在加载.但是,此图形会无限期地显示,并且没有任何反应.没有提供错误消息.我该如何解决或至少诊断此问题?

After entering npm start in the directory of my Node project, I see the spinning pipe symbol to show that npm is loading. However, this graphic is displayed indefinitely and nothing happens. No error messages are provided. How can I fix or at least diagnose this issue?

我的package.json如下:

{
  "name": "Project_Name",
  "version": "0.0.1",
  "private": true,
  "main": "./bin/www",
  "scripts": {
    "start": "node ./bin/www"
  },
  "dependencies": {
    "express": "~4.2.0",
    "static-favicon": "~1.0.0",
    "morgan": "~1.0.0",
    "cookie-parser": "~1.0.1",
    "body-parser": "~1.0.0",
    "debug": "~0.7.4",
    "jade": "~1.3.0",
    "request": "~2.39.0",
    "oauth-1.0a": "~0.1.1",
    "passport": "~0.2.0",
    "express-session": "~1.7.2",
    "passport-local": "~1.0.0",
    "connect-flash": "~0.1.1"
  }
}

我怀疑缺少依赖项可能是个问题,但这似乎不是问题.我运行了 npm-install-missing 模块并得到以下结果:

I suspected that missing dependencies could be a problem, but that doesn't seem to be an issue. I ran the npm-install-missing module and got the following results:

推荐答案

经过多次uninstallinstallnodenpm 问题是我在 ~/ 目录

After several uninstall and install to node and npm the problem was that I set ignore-scripts=true in .npmrc at ~/ directory

所以要解决这个问题:

nano ~/.npmrc

删除行 ignore-scripts=true 或将其更改为

remove the line ignore-scripts=true or change it to be

ignore-scripts=false

在尝试不同的极端解决方案大约一个小时后,这解决了我的问题.

This solved my problem after about an hour of trying different extreme solutions.

这篇关于命令 `npm start` 什么都不做的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆