create-react-app
create-react-app copied to clipboard
M1的 macbook pro, npx create-react-app my-app
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.
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.
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 %
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