英文:
cannot run **npm start** after installing cra with typescript
问题
I'm trying to get started with react & typescript. After creating an empty folder in vscode then I create a TypeScript app with npx create-react-app react-script-demo --template typescript
, the installation completed. But after running npm start
, I got these errors:
'typescript\react-script-demo\node_modules.bin' is not recognized as an internal or external command,
operable program or batch file.
node:internal/modules/cjs/loader:936
throw err;
^Error: Cannot find module 'C:*******\react-scripts\bin\react-scripts.js'
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
I checked other questions on StackOverflow, but none of them worked for me.
英文:
I'm trying to get started with react & typescript . After creating an empty folder in vscode then I create a TypeScript app with npx create-react-app react-script-demo --template typescript
the installating completed . but after running npm start
. I got theese errors :
> 'typescript\react-script-demo\node_modules.bin' is not recognized as an internal or external command,
> operable program or batch file.
> node:internal/modules/cjs/loader:936
> throw err;
> ^
>
> Error: Cannot find module 'C:*******\react-scripts\bin\react-scripts.js'
> at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
> at Function.Module._load (node:internal/modules/cjs/loader:778:27)
> at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
> at node:internal/main/run_main_module:17:47 {
> code: 'MODULE_NOT_FOUND',
> requireStack: []
> }
I checked other question in stackoverflow but none of them worked for me
答案1
得分: 1
这个错误与安装无关。我发现错误是因为父文件夹的名称包含 & (Ampersand)
。将该文件夹重命名为不含 & 符号解决了问题。
英文:
this error has nothing to do with the installation. I figured out that the error is coming from the name of the parent folder containing an & (Ampersand)
. renaming this folder with no & symbol solved the problem
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论