create-react-app icon indicating copy to clipboard operation
create-react-app copied to clipboard

M1的 macbook pro, npx create-react-app my-app

Open jianguo888 opened this issue 1 year ago • 1 comments

M1的 macbook pro, npx create-react-app my-app

jianguo@jianguodeMacBook-Pro test % npx create-react-app my-app

Creating a new React app in /Users/jianguo/Desktop/test/my-app.

/Users/jianguo/node_modules/npm/node_modules/osenv/osenv.js:49 return os.tmpDir() ^

TypeError: os.tmpDir is not a function at /Users/jianguo/node_modules/npm/node_modules/osenv/osenv.js:49:13 at exports. [as tmpdir] (/Users/jianguo/node_modules/npm/node_modules/osenv/osenv.js:14:15) at Object. (/Users/jianguo/node_modules/npm/lib/config/defaults.js:89:18) at Module._compile (node:internal/modules/cjs/loader:1256:14) at Module._extensions..js (node:internal/modules/cjs/loader:1310:10) at Module.load (node:internal/modules/cjs/loader:1119:32) at Module._load (node:internal/modules/cjs/loader:960:12) at Module.require (node:internal/modules/cjs/loader:1143:19) at require (node:internal/modules/cjs/helpers:121:18) at Object. (/Users/jianguo/node_modules/npm/lib/config/core.js:4:18)

Node.js v18.17.1 Installing packages. This might take a couple of minutes. Installing react, react-dom, and react-scripts...

/Users/jianguo/node_modules/npm/node_modules/osenv/osenv.js:49 return os.tmpDir() ^

TypeError: os.tmpDir is not a function at /Users/jianguo/node_modules/npm/node_modules/osenv/osenv.js:49:13 at exports. [as tmpdir] (/Users/jianguo/node_modules/npm/node_modules/osenv/osenv.js:14:15) at Object. (/Users/jianguo/node_modules/npm/lib/config/defaults.js:89:18) at Module._compile (node:internal/modules/cjs/loader:1256:14) at Module._extensions..js (node:internal/modules/cjs/loader:1310:10) at Module.load (node:internal/modules/cjs/loader:1119:32) at Module._load (node:internal/modules/cjs/loader:960:12) at Module.require (node:internal/modules/cjs/loader:1143:19) at require (node:internal/modules/cjs/helpers:121:18) at Object. (/Users/jianguo/node_modules/npm/lib/config/core.js:4:18)

Node.js v18.17.1

Aborting installation. npm install --no-audit --save --save-exact --loglevel error react react-dom [email protected] has failed.

Deleting generated file... package.json Deleting my-app/ from /Users/jianguo/Desktop/test Done. jianguo@jianguodeMacBook-Pro test %

jianguo888 avatar Dec 19 '23 14:12 jianguo888

Screenshot 2023-12-22 at 2 25 08 PM As you can see i tried the same command npx create-react-app my-app with the node version of 18.17.1 and npm version 9.7.6 and npx version 9.7.6 The device configuration is Mac Mini M1 (mac mini 9,1) . but it is working fine i didn't get any error while creating react project

if possible can you provide more details so that we can help you with the same.

or

you can try to clean npm cache or if its okay with you try reinstalling your node version again and try once more

manprit-tiwari avatar Dec 22 '23 09:12 manprit-tiwari