SAP / node-rfc

Asynchronous, non-blocking SAP NW RFC SDK bindings for Node.js
Apache License 2.0
252 stars 74 forks source link

Missing folder -> node_modules\node-rfc\node_modules\yallist when uninstalling another npm package #70

Closed cjbailey closed 5 years ago

cjbailey commented 5 years ago

Sometimes I get an error when I'm trying to uninstall another npm package (not node-rfc):

PS C:\Users\????\Documents\????> npm uninstall c3
npm WARN ????@0.0.1 No repository field.
npm WARN ????@0.0.1 No license field.

npm ERR! path C:\Users\????\Documents\????\node_modules\node-rfc\node_modules\yallist
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\????\Documents\????\node_modules\node-rfc\node_modules\yallist' -> 'C:\Users\????\Documents\????\node_modules\node-rfc\node_modules\.yallist.DELETE'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

I've replaced certain sensitive details with '????' for obvious reasons.

Wondering if I'm doing something wrong or whether this is a bug with npm or node-rfc?

bsrdjan commented 5 years ago

Certain node versions are shipped with default older npm versions, which cause issues and are not any more supported, as discussed here.

Could you please share your versions of node, node-rfc and npm?

cjbailey commented 5 years ago

Wow, super quick response Srdjan!

npm - v5.6.0 node - v8.11.1 node-rfc - 0.1.16 <- this surprised me as I had installed via npm install node-rfc@next and expected the version to be higher

cjbailey commented 5 years ago

p.s. in my package.json I have:

"node-rfc": "^1.0.0-rc5",

bsrdjan commented 5 years ago

I tested on Windows with node 8.11.1 and npm 5.6.0 and could not reproduce.

With empty package.json dependencies I first installed the node-rfc@latest, getting the 0.1.16 installed. Then:

C:\src\test  (test@1.0.0)
λ cat package.json
{
  "name": "test",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "node-rfc": "^0.1.16"
  }
}

C:\src\test  (test@1.0.0)
λ npm uninstall node-rfc
npm WARN test@1.0.0 No description
npm WARN test@1.0.0 No repository field.

removed 134 packages in 1.772s
found 0 vulnerabilities

C:\src\test  (test@1.0.0)
λ npm i node-rfc@next

> node-rfc@1.0.0-rc7 preinstall C:\src\test\node_modules\node-rfc
> npm install node-pre-gyp node-addon-api

npm notice created a lockfile as package-lock.json. You should commit this file.
+ node-addon-api@1.6.2
+ node-pre-gyp@0.12.0
added 1 package from 32 contributors, updated 1 package and audited 96 packages in 2.198s
found 0 vulnerabilities

> node-rfc@1.0.0-rc7 install C:\src\test\node_modules\node-rfc
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using needle for node-pre-gyp https download
[node-rfc] Success: "C:\src\test\node_modules\node-rfc\lib\binding\win32-x64-node-v67\sapnwrfc.node" is installed via remote
npm WARN test@1.0.0 No description
npm WARN test@1.0.0 No repository field.

+ node-rfc@1.0.0-rc7
added 75 packages from 61 contributors and audited 104 packages in 7.518s
found 0 vulnerabilities

C:\src\test  (test@1.0.0)
λ cat package.json
{
  "name": "test",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "node-rfc": "^1.0.0-rc7"
  }
}

C:\src\test  (test@1.0.0)
λ

Perhaps to upgrade npm npm -g install npm and retry ?

cjbailey commented 5 years ago

Thanks Srdjan, I'll give it a go. I'm feeling it's probably just that I've managed to mess up my install somehow. If all else fails I'll delete my package.json, package-lock.json and node_modules folder and re-install everything manually from the beginning.

I'll close the issue for now and report back if I find out anything else.

cjbailey commented 5 years ago

Well how's about that! Updating npm seemed to work a treat! I have now uninstalled c3.js without a hitch. Thanks again Srdjan, I really appreciate your help and super quick responses. :)