trekhleb / javascript-algorithms

📝 Algorithms and data structures implemented in JavaScript with explanations and links to further readings
MIT License
185.13k stars 29.86k forks source link

error when run npm install #956

Closed ffxixslh closed 1 year ago

ffxixslh commented 1 year ago

2165 verbose stack TypeError: Cannot read properties of null (reading 'pickAlgorithm') 2165 verbose stack at Integrity.match (D:\nvm\v16.14.0\node_modules\npm\node_modules\ssri\index.js:234:24) 2165 verbose stack at CachePolicy.satisfies (D:\nvm\v16.14.0\node_modules\npm\node_modules\make-fetch-happen\lib\cache\policy.js:113:49) 2165 verbose stack at Function.find (D:\nvm\v16.14.0\node_modules\npm\node_modules\make-fetch-happen\lib\cache\entry.js:172:25) 2165 verbose stack at async cacheFetch (D:\nvm\v16.14.0\node_modules\npm\node_modules\make-fetch-happen\lib\cache\index.js:8:17) 2165 verbose stack at async fetch (D:\nvm\v16.14.0\node_modules\npm\node_modules\make-fetch-happen\lib\fetch.js:82:7) 2166 verbose cwd D:\javascript-algorithms\javascript-algorithms-master 2167 verbose Windows_NT 10.0.19044 2168 verbose argv "D:\nodejs\node.exe" "D:\nodejs\node_modules\npm\bin\npm-cli.js" "install" 2169 verbose node v16.14.0 2170 verbose npm v8.3.1 2171 error Cannot read properties of null (reading 'pickAlgorithm') 2172 verbose exit 1 2173 timing npm Completed in 35872ms 2174 verbose unfinished npm timer reify 1667460098750 2175 verbose unfinished npm timer reify:unpack 1667460115749 2176 verbose unfinished npm timer reifyNode:node_modules/pirates 1667460115774 2177 verbose unfinished npm timer reifyNode:node_modules/jsdom 1667460115784 2178 verbose unfinished npm timer reifyNode:node_modules/eslint-plugin-react 1667460115821 2179 verbose code 1

I've tried to install many times, and it occured this problem everytime. But last night when I ran npm install on my friend's laptop(the node version is same to mine), it could install successfully, so weird😂 Hoping to get some help🙏

ffxixslh commented 1 year ago

I found that I onced set a npmmirror, and maybe it caused the problem. When I annotated it and ran npm install again, it worked😅