Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local packages ENOENT .npm missing #7711

Closed
zapaz opened this issue Aug 25, 2016 · 12 comments
Closed

Local packages ENOENT .npm missing #7711

zapaz opened this issue Aug 25, 2016 · 12 comments

Comments

@zapaz
Copy link

zapaz commented Aug 25, 2016

[1.4.1.1] local packages ENOENT .npm missing

On ‘meteor run’ got this error :

=> Started MongoDB.
local:pack: updating npm dependencies -- diacritics, url, fs-extra...
/root/.meteor/packages/fourseven_scss/.3.9.0.1xdzbya++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/promise/node_modules/meteor-promise/promise_server.js:165
throw error;
^

Error: ENOENT: no such file or directory, rename '/home/app/packages/local_pack/.npm/package-new-14mph1f' -> '/home/packages/local:pack/.npm/package'
at Error (native)
at Object.fs.renameSync (fs.js:681:18)

Local package ‘local:pack’ is linked inside packages folder into another directory:
/home/app/packages/local:pack -> ../../packages/pack

Seems meteor, some times take local:pack and other times a sanitized version local_pack
Moreover it creates /home/app/packages/local_pack directory with .npm inside

One solution to get rid of the error is to add .npm directory manually inside all local packages /home/packages/*

With lot of local packages this script helps :
cd /home/packages ;
for i in * ; do mkdir $i/.npm ; done

@cvax
Copy link

cvax commented Aug 25, 2016

I'm getting this on 1.4.1.1 with any packages that has not been previously installed on prior versions of Meteor. If I go back to an older, say 1.4.0.1 project, and run "meteor add" on it, it adds the package. Then when I go back to 1.4.1.1 and try to add the same package a second time it starts to work.

I am on Win7 x64.

https://forums.meteor.com/t/raix-ui-dropped-event-error-enoent-on-windows7-x64/28465/2

@valentinvichnal
Copy link

+1

@quintstoffers
Copy link

I'm seeing this as well. In our case my case I didn't add the .npm directories in version control, causing this error on my CI environment. Adding the .npm directories to VCS fixed the error, but causes the Meteor server to restart once after installing the packages.

@abernix
Copy link
Contributor

abernix commented Sep 14, 2016

Not confirming as a bug as I haven't had time to reproduce, but for the purposes of issue tracking, if someone could provide the exact shell commands to reproduce this from scratch it would facilitate any fix for this!

@zapaz
Copy link
Author

zapaz commented Sep 15, 2016

@abernix here is a script to reproduce the problem :

#!/bin/bash

meteor create issue-7711
cd issue-7711
mkdir packages
cd packages
meteor create --package my:pack
ls
# 'pack' directory created instead of my:pack
mv pack my:pack
cd my:pack
> pack.js
echo "Npm.depends({'fs-extra':'0.30.0'})" >> package.js
cd ../..
meteor add my:pack
# crash
ls packages
# wrong directory created with .npm, create good one :
mkdir packages/my:pack/.npm
meteor add my:pack
# works fine ...
cd ..
rm -rf issue-7711

@abernix abernix added confirmed We want to fix or implement it Impact:few Project:Isobuild labels Sep 21, 2016
@abernix
Copy link
Contributor

abernix commented Sep 21, 2016

Thank you very much for the reproduction! Someone will look into this as soon as possible.

@quintstoffers
Copy link

quintstoffers commented Oct 4, 2016

It turns out that this is causing our server to restart in our CI environment because the creation of the directory "foo_package" instead of "foo:package" triggers the file watchers. It's currently preventing us from updating to 1.4.1.1 from 1.4.0.1 because our tests fail because of the server restart.

@johanbrook
Copy link

johanbrook commented Oct 28, 2016

I get this issue for our lookback:emails package when running in CI: https://circleci.com/gh/lookback/meteor-emails/3:

...
   Building package lookback:emails          /

/home/ubuntu/.meteor/packages/meteor-tool/.1.4.1_1.pjl67t++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/meteor-promise/promise_server.js:165
      throw error;
      ^

Error: ENOENT: no such file or directory, rename '/home/ubuntu/meteor-emails/example/packages/lookback_emails/.npm/package-new-1j4yiic' -> '/home/ubuntu/meteor-emails/example/packages/lookback:emails/.npm/package'
    at Error (native)
    at Object.fs.renameSync (fs.js:681:18)
    at Object.wrapper [as rename] (/tools/fs/files.js:1519:35)
    at Object.files.renameDirAlmostAtomically (/tools/fs/files.js:968:9)

Works locally though, when invoking the npm test command (as the CI does).

Edit: Renaming the package to emails from lookback:emails in the app's packages dir fixed the problem, according to @zapaz's script.

@abernix
Copy link
Contributor

abernix commented Dec 2, 2016

I believe this bug was caused by the fix to #7661, as I explained in #7661 (comment).

As I explain in that comment, I think the fix would be to use abernix@991eb1d instead of the previous commits (61c1ab0 + 4c1fe8f).

I believe it would be safe to make that change.

@hwillson
Copy link
Contributor

hwillson commented Nov 2, 2017

I've confirmed this is still happening with Meteor 1.6.

@hwillson hwillson changed the title [1.4.1.1] local packages ENOENT .npm missing Local packages ENOENT .npm missing Nov 2, 2017
@hwillson
Copy link
Contributor

There hasn't been any activity on this issue in quite some time, so I'll close it for now. If anyone is still encountering this problem, and is interested in working on a fix, please let us know. Thanks!

@ujwal-setlur
Copy link

This is still an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants