没有 npm 脚本适用于 React 项目
No npm scripts works from react project
我有一个 React 应用程序,它已经运行了很长时间,突然 package.JSON 文件中的 none 的 npm 命令开始工作了。
{
"name": "fitness-appication-frontend",
"version": "0.1.0",
"private": true,
"dependencies": {
"react": "^16.10.2",
"react-chat-ui": "^0.3.2",
"react-dom": "^16.10.2",
"react-scripts": "0.9.5"
},
"devDependencies": {},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
}
}
每当我尝试 运行 一个 npm 命令时,终端中什么也没有发生,它只是 returns 像这样空白
kristoffer@kristoffer-ThinkPad-T570:~/Skrivebord/Fitness-Application/fitness-application-frontend$ npm start
kristoffer@kristoffer-ThinkPad-T570:~/Skrivebord/Fitness-Application/fitness-application-frontend$
有人熟悉这个问题吗?
只有当我尝试 运行 这些命令时才会发生,内置的命令,如 npm install
工作得很好。
npm start run -dd
的输出
npm info it worked if it ends with ok
npm verb cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'start', '-dd' ]
npm info using npm@3.5.2
npm info using node@v8.10.0
npm verb run-script [ 'prestart', 'start', 'poststart' ]
npm info lifecycle fitness-appication-frontend@0.1.0~prestart: fitness-appication-frontend@0.1.0
npm info lifecycle fitness-appication-frontend@0.1.0~start: fitness-appication-frontend@0.1.0
npm info lifecycle fitness-appication-frontend@0.1.0~poststart: fitness-appication-frontend@0.1.0
npm verb exit
发生这种情况是因为您有
ignore-scripts=true
来自文档:
ignore-scripts
Default: false
Type: Boolean
If true, npm does not run scripts specified in package.json files.
勾选这个link
P.S。您可以使用 git log <branch name>
检查此更改何时完成
我有一个 React 应用程序,它已经运行了很长时间,突然 package.JSON 文件中的 none 的 npm 命令开始工作了。
{
"name": "fitness-appication-frontend",
"version": "0.1.0",
"private": true,
"dependencies": {
"react": "^16.10.2",
"react-chat-ui": "^0.3.2",
"react-dom": "^16.10.2",
"react-scripts": "0.9.5"
},
"devDependencies": {},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
}
}
每当我尝试 运行 一个 npm 命令时,终端中什么也没有发生,它只是 returns 像这样空白
kristoffer@kristoffer-ThinkPad-T570:~/Skrivebord/Fitness-Application/fitness-application-frontend$ npm start
kristoffer@kristoffer-ThinkPad-T570:~/Skrivebord/Fitness-Application/fitness-application-frontend$
有人熟悉这个问题吗?
只有当我尝试 运行 这些命令时才会发生,内置的命令,如 npm install
工作得很好。
npm start run -dd
npm info it worked if it ends with ok
npm verb cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'start', '-dd' ]
npm info using npm@3.5.2
npm info using node@v8.10.0
npm verb run-script [ 'prestart', 'start', 'poststart' ]
npm info lifecycle fitness-appication-frontend@0.1.0~prestart: fitness-appication-frontend@0.1.0
npm info lifecycle fitness-appication-frontend@0.1.0~start: fitness-appication-frontend@0.1.0
npm info lifecycle fitness-appication-frontend@0.1.0~poststart: fitness-appication-frontend@0.1.0
npm verb exit
发生这种情况是因为您有
ignore-scripts=true
来自文档:
ignore-scripts
Default: false
Type: Boolean
If true, npm does not run scripts specified in package.json files.
勾选这个link
P.S。您可以使用 git log <branch name>
检查此更改何时完成