新计算机上出现“反应脚本启动”错误

时间:2018-09-21 14:06:52

标签: reactjs npm console

我用“ create react app”创建了一个项目(在macOS上为 ),并在git上提交。

现在,我正在Windows上克隆该文件夹,并按照通常的步骤进行操作:

节点 npm npm install

无论如何我都遇到了这个问题:

 $ 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

(我知道...有些东西是意大利语,无论如何,最重要的东西还是英语。)

Package.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"
  }
}

在网络和堆栈上进行了大量研究...很多用户遇到了这个问题,但是他们的解决方案都不适合我。

有什么建议吗?

非常感谢。

1 个答案:

答案 0 :(得分:0)

解决方案:

使用PARALLELS ...确保您的项目不在两个操作系统之间的“共享”空间上。

我无法在mac文件夹中执行项目。 无法在共享空间上执行

仅在Windows空间上工作。

谢谢。