Reactjs React-克隆存储库npm安装不工作
我在github教程中有一个重要的存储库,当我克隆这个存储库,然后npm安装时,npm start不起作用。这是我在终端中看到的:Reactjs React-克隆存储库npm安装不工作,reactjs,npm,Reactjs,Npm,我在github教程中有一个重要的存储库,当我克隆这个存储库,然后npm安装时,npm start不起作用。这是我在终端中看到的: react-scripts start sh: react-scripts: command not found npm ERR! file sh npm ERR! code ELIFECYCLE npm ERR! errno ENOENT npm ERR! syscall spawn npm ERR! 01@0.1.0 start: `react-scripts
react-scripts start
sh: react-scripts: command not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! 01@0.1.0 start: `react-scripts start`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the 01@0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/kacperfaligowski/.npm/_logs/2020-03-19T01_09_33_794Z-debug.log
试图解决这个问题,但两个小时内什么都做不了。我的npm版本是-6.4.1。
我必须这样做,因为我无法完成教程的下一步。
请帮帮我。谢谢
package.json:
{
"name": "01",
"version": "0.1.0",
"private": true,
"dependencies": {
"@storybook/addon-knobs": "^5.0.3",
"husky": "^1.3.1",
"modern-normalize": "^0.5.0",
"react": "^16.8.4",
"react-dom": "^16.8.4",
"react-scripts": "2.1.8",
"styled-components": "^4.1.3"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"storybook": "start-storybook -p 9009 -s public",
"build-storybook": "build-storybook -s public"
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
],
"devDependencies": {
"eslint": "^5.12.0",
"eslint-config-airbnb": "^17.1.0",
"eslint-config-prettier": "^4.1.0",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-react": "^7.12.4",
"lint-staged": "^8.1.5",
"prettier": "^1.16.4",
"@storybook/react": "^5.0.3",
"@storybook/addon-actions": "^5.0.3",
"@storybook/addon-links": "^5.0.3"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.js": [
"prettier --config .prettierrc --write",
"eslint --fix",
"git add"
]
}
}
我的npm安装无法安装存储库中的所有依赖项。 我修复了使用以下方法全局更新npm的问题:
sudo npm install -g npm@latest
请为package.json文件添加一些代码我现在又添加了一件事,repo是否有package-lock.json或warn.lock文件?哪一个?这两个都有吗