0

My problem is similar to this. The npm command show no response at all.

I find npm.cmd, and comment the @ECHO OFF and run npm -v, I get:

C:\Users\Office>npm -v

C:\Users\Office>SETLOCAL

C:\Users\Office>SET "NODE_EXE=D:\Program Files\nodejs\\node.exe"

C:\Users\Office>IF NOT EXIST "D:\Program Files\nodejs\\node.exe" (SET "NODE_EXE=node" )

C:\Users\Office>SET "NPM_CLI_JS=D:\Program Files\nodejs\\node_modules\npm\bin\npm-cli.js"

C:\Users\Office>FOR /F "delims=" %F IN ('CALL "D:\Program Files\nodejs\\node.exe" "D:\Program Files\
nodejs\\node_modules\npm\bin\npm-cli.js" prefix -g') DO (SET "NPM_PREFIX_NPM_CLI_JS=%F\node_modules\
npm\bin\npm-cli.js" )

then nothing happen. the file at ~\.npmrc shows prefix="'C:\\Users\\Office\\AppData\\Roaming\\npm'". However, the folder C:\Users\Office\AppData\Roaming\npm is empty!!

I've reinstalled the nodejs many times. and follow the answer here won't help. Does anyone have any suggestion?

Jacky Lau
  • 665
  • 5
  • 21

1 Answers1

0

i solve the problem by changing prefix="'C:\\Users\\Office\\AppData\\Roaming\\npm'" to prefix="C:\\Users\\Office\\AppData\\Roaming\\npm"

i.e. removing the signle quotation mark.

Jacky Lau
  • 665
  • 5
  • 21