【发布时间】:2018-09-21 14:06:51
【问题描述】:
我用“创建反应应用程序”创建了一个项目(在 macOS 上)并在 git 上提交。
现在我正在 Windows 上克隆该文件夹,并按照通常的步骤进行操作:
节点 npm npm 安装
无论如何我都会遇到这个问题:
$ npm start
> name@0.1.0 start \\Mac\Home\Desktop\WindowsProgetti\WebApp
> react-scripts start
'\\Mac\Home\Desktop\WindowsProgetti\WebApp'
CMD.EXE è stato avviato utilizzando il percorso precedente come directory
corrente. I percorsi UNC non sono supportati. Per impostazione predefinita,
verrà utilizzata la directory di Windows.
internal/modules/cjs/loader.js:583
throw err;
^
Error: Cannot find module '\\Mac\Home\Desktop\WindowsProgetti\WebApp\node_modules\react-scripts\bin\react-scripts.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
at Function.Module._load (internal/modules/cjs/loader.js:507:25)
at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
at startup (internal/bootstrap/node.js:279:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:752:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! name@0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the matchplat@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! C:\Users\fabio\AppData\Roaming\npm-cache\_logs\2018-09-21T13_56_21_061Z-debug.log
(我知道......有些东西是意大利语,最重要的是英语。)
包.json
{
"name": "name",
"version": "0.1.0",
"private": true,
"homepage": "http://localhost:3000",
"dependencies": {
"@material-ui/core": "^3.0.0",
"@material-ui/icons": "^3.0.0",
"create-react-app": "^1.5.2",
"react": "^16.4.2",
"react-dom": "^16.4.2",
"react-intl": "^2.4.0",
"react-loadable": "^5.5.0",
"react-router-dom": "^4.3.1",
"react-scripts": "1.1.5"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
}
}
在网络和堆栈上进行了大量研究...很多用户遇到这个问题,但他们的解决方案都不适合我。
有什么建议吗?
非常感谢。
【问题讨论】:
-
尝试删除 node_modules + package-lock.json 然后运行 npm i
-
@Modig 错误:找不到模块 'C:\Windows\lib\post_install.js'
-
也许你可以在他们的 gitHub 上发布你的问题 github.com/facebook/create-react-app/issues