my node version is 10.13.0, i'm using this version because of a specific project dependency and i'm using my office laptop, I'm also having +-- [email protected] +-- [email protected] `-- [email protected]

i want to install "npm i -g @microsoft/generator-sharepoint" but i'm getting error "code EEXIST"

I'm new to this so don't have much knowledge what is this and i'm working on this for 2 days still not able to fix it.

npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: The functionality that this package provided is now in @npmcli/arborist
npm WARN deprecated [email protected]: This functionality has been moved to @npmcli/fs
npm WARN deprecated [email protected]: This SVGO version is no longer supported. Upgrade to v2.x.x.
npm WARN deprecated [email protected]: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated [email protected]: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated [email protected]: "Please update to latest v2.3 or v2.2"
npm WARN deprecated @npmcli/[email protected]: This functionality has been moved to @npmcli/fs
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.2 (node_modules\@microsoft\generator-sharepoint\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules\@microsoft\generator-sharepoint\node_modules\watchpack-chokidar2\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.2 (node_modules\@microsoft\generator-sharepoint\node_modules\@rushstack\typings-generator\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN [email protected] requires a peer of yeoman-environment@^3.2.0 but none is installed. You must install peer dependencies yourself.
npm WARN @rushstack/[email protected] requires a peer of @types/webpack@* but none is installed. You must install peer dependencies yourself.
npm WARN @rushstack/[email protected] requires a peer of @types/webpack-sources@* but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of encoding@^0.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN @rushstack/[email protected] requires a peer of @types/webpack@^4.39.0 but none is installed. You must install peer dependencies yourself.
npm WARN @rushstack/[email protected] requires a peer of @types/webpack@^4.39.8 but none is installed. You must install peer dependencies yourself.
npm WARN @rushstack/[email protected] requires a peer of webpack@^5.35.1 but none is installed. You must install peer dependencies yourself.
npm WARN @microsoft/[email protected] requires a peer of @types/webpack@^4 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of node-sass@^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of fibers@>= 3.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of encoding@^0.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of encoding@^0.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN @rushstack/[email protected] requires a peer of @types/webpack@^4.39.8 but none is installed. You must install peer dependencies yourself.
npm WARN @rushstack/[email protected] requires a peer of webpack@^5.35.1 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of bufferutil@^4.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of utf-8-validate@>=5.0.2 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of ajv@^8.0.0 but none is installed. You must install peer dependencies yourself.

npm ERR! path C:\Users\AryanSharma\AppData\Roaming\npm\node_modules\@microsoft\generator-sharepoint\node_modules\.bin\browserslist.cmd
npm ERR! code EEXIST
npm ERR! Refusing to delete C:\Users\AryanSharma\AppData\Roaming\npm\node_modules\@microsoft\generator-sharepoint\node_modules\.bin\browserslist.cmd: is outside C:\Users\AryanSharma\AppData\Roaming\npm\node_modules\@microsoft\generator-sharepoint\node_modules\browserslist and not a link
npm ERR! File exists: C:\Users\AryanSharma\AppData\Roaming\npm\node_modules\@microsoft\generator-sharepoint\node_modules\.bin\browserslist.cmd
npm ERR! Move it away, and try again.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\AryanSharma\AppData\Roaming\npm-cache\_logs\2023-02-02T09_55_50_116Z-debug.log

I want to create a new webpart but so many errors

2

There are 2 best solutions below

0
Zehui Yao On

as this error suggests: npm ERR! Move it away, and try again. Please Check whether you have installed the package in your environment, and then try to remove and reinstall it.

0
Don Kirkham On

The version of the yeoman template you are trying to install is not compatible with NodeJs v10.13.1. Use the following command instead

npm i -g @microsoft/[email protected]

The full list of SPFx compatibility can be found at https://learn.microsoft.com/en-us/sharepoint/dev/spfx/compatibility

From that list, you can see that SPFx v1.12.1 is the last version that supported NodeJs v10.x

Also, you should remove gulp from the global space and replace it with gulp-cli by running the following commands

npm uninstall - gulp
npm i -g gulp-cli

Having typescript installed is also unneeded, so that can be uninstalled. Lastly, you can always ignore the WARN messages.

Good luck!

Good luck!Don


If my answer helps solve or resolve your issue, please consider clicking Mark as Best Response & Like. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it a Like.