Giter Club home page Giter Club logo

Comments (22)

bajtos avatar bajtos commented on July 1, 2024 2

Thank you @achrinza for investigating the issue! I suspect the problem was introduced by #205, where we added sub-packages to deps where node_modules folders are created during npm install time.

I think the fix is to add fix npm configuration so that deps/juggler-{v3,v4}/node_modules files are not published. In my experience, it's better to use files entry in package.json (a white-list of files to include) rather than .npmignore (a black-list of files to exclude).

After landing the fix, we can publish a new version 3.7.1.

I think this problem can affect other connectors that are running both juggler v3 and v4 tests.

from loopback-connector-mssql.

Dayof avatar Dayof commented on July 1, 2024 2

Thank you for solving the issue ! @achrinza @dhmlau @bajtos @raymondfeng 🚀

from loopback-connector-mssql.

achrinza avatar achrinza commented on July 1, 2024 1

@nsabourin Thanks for the additional info; I was able to replicate it from my end.

Unfortunately I haven't been able to find a fix for the issue yet.

In the mean time, there's 4 tested 1 recommended workaround:

  • Utilize Yarn 2

  • Use a non-Windows environment

  • Downgrade package to v3.6.0

  • Install from source with specific commit-ish

    npm i git://github.com/strongloop/loopback-connector-mssql.git#063a7d0342f65011ad427be6f5eae4624d0a6dc3
    

Regrettably these workarounds require some form of compromise.

Significant updates will continue to be posted here.

Disclaimer

As a community maintainer, I don't speak on behalf of StrongLoop or IBM.

from loopback-connector-mssql.

achrinza avatar achrinza commented on July 1, 2024 1

I was able to replicate the issue with a local install of the 3.7.0 tarball from the NPM registry:

Error logs
C:\Users\rifaa\Documents\testapp>npm i ../../Downloads/loopback-connector-mssql-3.7.0.tgz
npm WARN [email protected] No license field.

npm ERR! code EPERM
npm ERR! syscall rename
npm ERR! path C:\Users\rifaa\Documents\testapp\node_modules\loopback-connector-mssql\node_modules\.adal-node.DELETE\node_modules\@types
npm ERR! dest C:\Users\rifaa\Documents\testapp\node_modules\loopback-connector-mssql\node_modules\adal-node\node_modules\@types
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, rename 'C:\Users\rifaa\Documents\testapp\node_modules\loopback-connector-mssql\node_modules\.adal-node.DELETE\node_modules\@types' -> 'C:\Users\rifaa\Documents\testapp\node_modules\loopback-connector-mssql\node_modules\adal-node\node_modules\@types'
npm ERR!  [OperationalError: EPERM: operation not permitted, rename 'C:\Users\rifaa\Documents\testapp\node_modules\loopback-connector-mssql\node_modules\.adal-node.DELETE\node_modules\@types' -> 'C:\Users\rifaa\Documents\testapp\node_modules\loopback-connector-mssql\node_modules\adal-node\node_modules\@types'] {
npm ERR!   cause: [Error: EPERM: operation not permitted, rename 'C:\Users\rifaa\Documents\testapp\node_modules\loopback-connector-mssql\node_modules\.adal-node.DELETE\node_modules\@types' -> 'C:\Users\rifaa\Documents\testapp\node_modules\loopback-connector-mssql\node_modules\adal-node\node_modules\@types'] {
npm ERR!     errno: -4048,
npm ERR!     code: 'EPERM',
npm ERR!     syscall: 'rename',
npm ERR!     path: 'C:\\Users\\rifaa\\Documents\\testapp\\node_modules\\loopback-connector-mssql\\node_modules\\.adal-node.DELETE\\node_modules\\@types',
npm ERR!     dest: 'C:\\Users\\rifaa\\Documents\\testapp\\node_modules\\loopback-connector-mssql\\node_modules\\adal-node\\node_modules\\@types'
npm ERR!   },
npm ERR!   stack: "Error: EPERM: operation not permitted, rename 'C:\\Users\\rifaa\\Documents\\testapp\\node_modules\\loopback-connector-mssql\\node_modules\\.adal-node.DELETE\\node_modules\\@types' -> 'C:\\Users\\rifaa\\Documents\\testapp\\node_modules\\loopback-connector-mssql\\node_modules\\adal-node\\node_modules\\@types'",
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'rename',
npm ERR!   path: 'C:\\Users\\rifaa\\Documents\\testapp\\node_modules\\loopback-connector-mssql\\node_modules\\.adal-node.DELETE\\node_modules\\@types',
npm ERR!   dest: 'C:\\Users\\rifaa\\Documents\\testapp\\node_modules\\loopback-connector-mssql\\node_modules\\adal-node\\node_modules\\@types',
npm ERR!   parent: 'loopback-connector-mssql'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\rifaa\AppData\Roaming\npm-cache\_logs\2020-03-05T03_59_42_725Z-debug.log

I tried checking out this repo at commit-ish 063a7d, and building the tarball with npm pack.

  • Without running npm install beforehand, this results in a working, installable local copy of the package. No node_modules was included in the generated tarball.

  • Running npm install beforehand results in the exact issue. The same node_modules were generated by npm install was included.

Unfortunately I'm not involved in the publishing of this package, hence I can only speculate what happened:

  • npm install was executed before npm publish for 3.7.0 resulting in node_modules being packaged.

A potential remedy is to:

  • Publish 3.7.1 with the correct procedure
  • Un-publish the problematic 3.7.0

from loopback-connector-mssql.

achrinza avatar achrinza commented on July 1, 2024

Does npm ci resolve the issue?

from loopback-connector-mssql.

nsabourin avatar nsabourin commented on July 1, 2024

@achrinza I have the same issue and it doesn't resolve it. it is working version 3.6.0. But, not version 3.7.0

from loopback-connector-mssql.

LuiguiBalarezo avatar LuiguiBalarezo commented on July 1, 2024

I ALSO HAVE THE SAME PROBLEM :v

npm WARN npm npm does not support Node.js v13.9.0
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 6, 8, 9, 10, 11, 12.
npm WARN npm You can find the latest version at https://nodejs.org/
npm WARN [email protected] No license field.

npm ERR! path C:\scriptGO\APIs\NODEJS\PRUEBA\ZVentas_API_LoopBack4\zventas-api-loopback4\node_modules\loopback-connector-mssql\node_modules.adal-node.DELETE\node_modules@types
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall rename
npm ERR! Error: EPERM: operation not permitted, rename 'C:\scriptGO\APIs\NODEJS\PRUEBA\ZVentas_API_LoopBack4\zventas-api-loopback4\node_modules\loopback-connector-mssql\node_modules.adal-node.DELETE\node_modules@types' -> 'C:\scriptGO\APIs\NODEJS\PRUEBA\ZVentas_API_LoopBack4\zventas-api-loopback4\node_modules\loopback-connector-mssql\node_modules\adal-node\node_modules@types'
npm ERR! [OperationalError: EPERM: operation not permitted, rename 'C:\scriptGO\APIs\NODEJS\PRUEBA\ZVentas_API_LoopBack4\zventas-api-loopback4\node_modules\loopback-connector-mssql\node_modules.adal-node.DELETE\node_modules@types' -> 'C:\scriptGO\APIs\NODEJS\PRUEBA\ZVentas_API_LoopBack4\zventas-api-loopback4\node_modules\loopback-connector-mssql\node_modules\adal-node\node_modules@types'] {
npm ERR! cause: [Error: EPERM: operation not permitted, rename 'C:\scriptGO\APIs\NODEJS\PRUEBA\ZVentas_API_LoopBack4\zventas-api-loopback4\node_modules\loopback-connector-mssql\node_modules.adal-node.DELETE\node_modules@types' -> 'C:\scriptGO\APIs\NODEJS\PRUEBA\ZVentas_API_LoopBack4\zventas-api-loopback4\node_modules\loopback-connector-mssql\node_modules\adal-node\node_modules@types']
{
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'rename',
npm ERR! path: 'C:\scriptGO\APIs\NODEJS\PRUEBA\ZVentas_API_LoopBack4\zventas-api-loopback4\node_modules\loopback-connector-mssql\node_modules\.adal-node.DELETE\node_modules\@types',
npm ERR! dest: 'C:\scriptGO\APIs\NODEJS\PRUEBA\ZVentas_API_LoopBack4\zventas-api-loopback4\node_modules\loopback-connector-mssql\node_modules\adal-node\node_modules\@types'
npm ERR! },
npm ERR! stack: "Error: EPERM: operation not permitted, rename 'C:\scriptGO\APIs\NODEJS\PRUEBA\ZVentas_API_LoopBack4\zventas-api-loopback4\node_modules\loopback-connector-mssql\node_modules\.adal-node.DELETE\node_modules\@types' -> 'C:\scriptGO\APIs\NODEJS\PRUEBA\ZVentas_API_LoopBack4\zventas-api-loopback4\node_modules\loopback-connector-mssql\node_modules\adal-node\node_modules\@types'",
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'rename',
npm ERR! path: 'C:\scriptGO\APIs\NODEJS\PRUEBA\ZVentas_API_LoopBack4\zventas-api-loopback4\node_modules\loopback-connector-mssql\node_modules\.adal-node.DELETE\node_modules\@types',
npm ERR! dest: 'C:\scriptGO\APIs\NODEJS\PRUEBA\ZVentas_API_LoopBack4\zventas-api-loopback4\node_modules\loopback-connector-mssql\node_modules\adal-node\node_modules\@types',
npm ERR! parent: 'loopback-connector-mssql'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator (though this is not recommended).

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\lbalarezo\AppData\Roaming\npm-cache_logs\2020-03-03T21_55_00_559Z-debug.log

from loopback-connector-mssql.

achrinza avatar achrinza commented on July 1, 2024

@nsabourin @LuiguiBalarezo Thanks for the feedback, we'll look into this where possible.

Disclaimer

As a community maintainer, I don't speak on behalf of StrongLoop or IBM.

from loopback-connector-mssql.

stephaneerard avatar stephaneerard commented on July 1, 2024

Same here

c:\test>npm install loopback-connector-mssql --save
npm WARN enoent ENOENT: no such file or directory, open 'c:\test\package.json'
npm WARN test No description
npm WARN test No repository field.
npm WARN test No README data
npm WARN test No license field.

npm ERR! code EPERM
npm ERR! syscall rename
npm ERR! path c:\test\node_modules\loopback-connector-mssql\node_modules\.adal-node.DELETE\node_modules\@types
npm ERR! dest c:\test\node_modules\loopback-connector-mssql\node_modules\adal-node\node_modules\@types
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, rename 'c:\test\node_modules\loopback-connector-mssql\node_modules\.adal-node.DELETE\node_modules\@types' -> 'c:\test\node_modules\loopback-connector-mssql\node_modules\adal-node\node_modules\@types'
npm ERR!  [OperationalError: EPERM: operation not permitted, rename 'c:\test\node_modules\loopback-connector-mssql\node_modules\.adal-node.DELETE\node_modules\@types' -> 'c:\test\node_modules\loopback-connector-mssql\node_modules\adal-node\node_modules\@types'] {
npm ERR!   cause: [Error: EPERM: operation not permitted, rename 'c:\test\node_modules\loopback-connector-mssql\node_modules\.adal-node.DELETE\node_modules\@types' -> 'c:\test\node_modules\loopback-connector-mssql\node_modules\adal-node\node_modules\@types'] {
npm ERR!     errno: -4048,
npm ERR!     code: 'EPERM',
npm ERR!     syscall: 'rename',
npm ERR!     path: 'c:\\test\\node_modules\\loopback-connector-mssql\\node_modules\\.adal-node.DELETE\\node_modules\\@types',
npm ERR!     dest: 'c:\\test\\node_modules\\loopback-connector-mssql\\node_modules\\adal-node\\node_modules\\@types'
npm ERR!   },
npm ERR!   stack: "Error: EPERM: operation not permitted, rename 'c:\\test\\node_modules\\loopback-connector-mssql\\node_modules\\.adal-node.DELETE\\node_modules\\@types' -> 'c:\\test\\node_modules\\loopback-connector-mssql\\node_modules\\adal-node\\node_modules\\@types'",
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'rename',
npm ERR!   path: 'c:\\test\\node_modules\\loopback-connector-mssql\\node_modules\\.adal-node.DELETE\\node_modules\\@types',
npm ERR!   dest: 'c:\\test\\node_modules\\loopback-connector-mssql\\node_modules\\adal-node\\node_modules\\@types',
npm ERR!   parent: 'loopback-connector-mssql'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrateur.WIN-EBQ49A4LTJ1\AppData\Roaming\npm-cache\_logs\2020-03-04T10_11_53_942Z-debug.log

c:\test>
c:\test>npm install loopback-connector-mssql --save

from loopback-connector-mssql.

achrinza avatar achrinza commented on July 1, 2024

@stephaneerard Thanks for providing error logs

From my findings from running npm i loopback-connector-mssql:

  • Error replicate-able on Windows,

    Error
    rifaa@LAPTOP-DHVDTT1Q MINGW64 ~/Documents/test-app
    $ npm install loopback-connector-mssql
    npm WARN [email protected] No license field.
    
    npm ERR! code EPERM
    npm ERR! syscall rename
    npm ERR! path C:\Users\rifaa\Documents\test-app\node_modules\loopback-connector-mssql\node_modules\.adal-node.DELETE\node_modules\@types
    npm ERR! dest C:\Users\rifaa\Documents\test-app\node_modules\loopback-connector-mssql\node_modules\adal-node\node_modules\@types
    npm ERR! errno -4048
    npm ERR! Error: EPERM: operation not permitted, rename 'C:\Users\rifaa\Documents\test-app\node_modules\loopback-connector-mssql\node_modules\.adal-node.DELETE\node_modules\@types' -> 'C:\Users\rifaa\Documents\test-app\node_modules\loopback-connector-mssql\node_modules\adal-node\node_modules\@types'
    npm ERR!  [OperationalError: EPERM: operation not permitted, rename 'C:\Users\rifaa\Documents\test-app\node_modules\loopback-connector-mssql\node_modules\.adal-node.DELETE\node_modules\@types' -> 'C:\Users\rifaa\Documents\test-app\node_modules\loopback-connector-mssql\node_modules\adal-node\node_modules\@types'] {
    npm ERR!   cause: [Error: EPERM: operation not permitted, rename 'C:\Users\rifaa\Documents\test-app\node_modules\loopback-connector-mssql\node_modules\.adal-node.DELETE\node_modules\@types' -> 'C:\Users\rifaa\Documents\test-app\node_modules\loopback-connector-mssql\node_modules\adal-node\node_modules\@types'] {
    npm ERR!     errno: -4048,
    npm ERR!     code: 'EPERM',
    npm ERR!     syscall: 'rename',
    npm ERR!     path: 'C:\\Users\\rifaa\\Documents\\test-app\\node_modules\\loopback-connector-mssql\\node_modules\\.adal-node.DELETE\\node_modules\\@types',
    npm ERR!     dest: 'C:\\Users\\rifaa\\Documents\\test-app\\node_modules\\loopback-connector-mssql\\node_modules\\adal-node\\node_modules\\@types'
    npm ERR!   },
    npm ERR!   stack: "Error: EPERM: operation not permitted, rename 'C:\\Users\\rifaa\\Documents\\test-app\\node_modules\\loopback-connector-mssql\\node_modules\\.adal-node.DELETE\\node_modules\\@types' -> 'C:\\Users\\rifaa\\Documents\\test-app\\node_modules\\loopback-connector-mssql\\node_modules\\adal-node\\node_modules\\@types'",
    npm ERR!   errno: -4048,
    npm ERR!   code: 'EPERM',
    npm ERR!   syscall: 'rename',
    npm ERR!   path: 'C:\\Users\\rifaa\\Documents\\test-app\\node_modules\\loopback-connector-mssql\\node_modules\\.adal-node.DELETE\\node_modules\\@types',
    npm ERR!   dest: 'C:\\Users\\rifaa\\Documents\\test-app\\node_modules\\loopback-connector-mssql\\node_modules\\adal-node\\node_modules\\@types',
    npm ERR!   parent: 'loopback-connector-mssql'
    npm ERR! }
    npm ERR!
    npm ERR! The operation was rejected by your operating system.
    npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
    npm ERR! or that you lack permissions to access it.
    npm ERR!
    npm ERR! If you believe this might be a permissions issue, please double-check the
    npm ERR! permissions of the file and its containing directories, or try running
    npm ERR! the command again as root/Administrator.
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     C:\Users\rifaa\AppData\Roaming\npm-cache\_logs\2020-03-04T10_25_19_627Z-debug.log
  • Ubuntu 18.04 LTS (via WSLv1) works fine (no error).

I also noticed there's no package-lock.json.

Between v3.6 and v3.7, there was no change in direct dependencies.

/cc @bajtos @raymondfeng

from loopback-connector-mssql.

stephaneerard avatar stephaneerard commented on July 1, 2024

Running npm install [email protected] works fine

from loopback-connector-mssql.

nsabourin avatar nsabourin commented on July 1, 2024

@achrinza
When I add manually version 3.6.0 in package.json and run npm install it doesn't work (same EPERM error as 3.7.0). But, npm install [email protected] work's fine as @stephaneerard mentioned. Maybe this detail could help to solve the problem ?

from loopback-connector-mssql.

achrinza avatar achrinza commented on July 1, 2024

Another workaround is available:

  • Install from source with the 3.7.0 commit-ish

    npm i git://github.com/strongloop/loopback-connector-mssql.git#063a7d0342f65011ad427be6f5eae4624d0a6dc3
    

My previous comment above has been updated to reflect this.

from loopback-connector-mssql.

achrinza avatar achrinza commented on July 1, 2024

Some findings:

and

  • In 3.7.0, deps/juggler-v3/node_modules was published. deps/juggler-v4/node_modules was not published.

    image

    image

  • In 3.6.0, neither of those node_modules were published.

I'm not too sure why there was this change in behaviour, as there wasn't any change in direct dependencies.

No node_modules were published to this GitHub repository either.

from loopback-connector-mssql.

bajtos avatar bajtos commented on July 1, 2024

If you look at loopback-connector-postgresql's .gitignore file, we have an entry to ignore all node_modules directories, see https://github.com/strongloop/loopback-connector-postgresql/blob/master/.gitignore

We use slt-release from https://github.com/strongloop/strong-tools to generate a changelog, create the release commit & tag, etc. This tool is creating an .npmrc file based on .gitignore file, adding few more entries that are often desired to ignore by npm but not by git.

In this repository, we have the following .gitignore entry:

https://github.com/strongloop/loopback-connector-mssql/blob/4f3421d658a7edb44e78eca94f7d034636622155/.gitignore#L15

I suspect it's either not honored by npm or the person publishing a new version of this connector did not use slt-release.

from loopback-connector-mssql.

bajtos avatar bajtos commented on July 1, 2024

Opened a PR to fix the problem, PTAL: #225

from loopback-connector-mssql.

raymondfeng avatar raymondfeng commented on July 1, 2024

It might have something to do with https://github.com/strongloop/loopback-connector-mssql/blob/master/package.json#L46. We had this in the past as https://github.com/facebook/regenerator/tree/master/packages/regenerator-runtime was under a restrictive license and now it's under MIT. Let's remove the prepublish script to see if it helps.

from loopback-connector-mssql.

raymondfeng avatar raymondfeng commented on July 1, 2024

BTW, we can use npm pack to verify if node_modules are included.

from loopback-connector-mssql.

emonddr avatar emonddr commented on July 1, 2024

BTW, we can use npm pack to verify if node_modules are included.

Correct, @bajtos mentions the steps in #225 . :)

from loopback-connector-mssql.

achrinza avatar achrinza commented on July 1, 2024

Linked PR #226

from loopback-connector-mssql.

achrinza avatar achrinza commented on July 1, 2024

Probably the root cause: npm/cli#417

Should we close the issue now that the PR has been merged?

from loopback-connector-mssql.

dhmlau avatar dhmlau commented on July 1, 2024

Closing as resolved.
@Dayof, if you still encounter this issue, please feel free to open a new issue. Thanks!

cc @emonddr

from loopback-connector-mssql.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.