Skip to content
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.

Added npm as dependency #78

Merged
merged 1 commit into from May 2, 2017
Merged

Added npm as dependency #78

merged 1 commit into from May 2, 2017

Conversation

saurabh95
Copy link
Collaborator

Copy link
Collaborator

@ficristo ficristo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I'm concerned this fixed my problem (at least locally)

Copy link
Collaborator

@swmitra swmitra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :+1

@swmitra swmitra merged commit 015e6a1 into master May 2, 2017
@swmitra swmitra deleted the saurabh95/add-npm-dependency branch May 2, 2017 02:43
@saurabh95
Copy link
Collaborator Author

@ficristo Updated the code on production server as well, Could you please verify it?

@ficristo
Copy link
Collaborator

ficristo commented May 3, 2017

Unfortunately the registry now give me this error:
"The extension package is invalid: An error occurred, but unfortunately I don't know how to say this nicely: NPM_INSTALL_FAILED"

@saurabh95
Copy link
Collaborator Author

@rationalcoding You also were also facing a similar issue, how did you resolve it?

@t-mullen
Copy link

t-mullen commented May 4, 2017

@ficristo My issue was having an empty "dependencies" field in my package.json.

ie)

"dependencies": {}

I guess this isn't accepted.

@ficristo
Copy link
Collaborator

ficristo commented May 4, 2017

I removed the "dependencies" fields from the package.json of https://github.com/ficristo/brackets-panels-hack and I was able to upload it.
But I wasn't able to upload https://github.com/ficristo/brackets-terminal-x where I cannot remove the "dependencies" field.
@saurabh95 maybe we should not use npm install on the registry? I don't know...

@saurabh95
Copy link
Collaborator Author

saurabh95 commented May 4, 2017

@ficristo I tried uploading a test extension using the same dependencies as yours, and I got this error on console.

npm ERR! Darwin 16.5.0
npm ERR! argv "/Users/kathpali/.nvm/versions/node/v6.9.5/bin/node" "/Users/kathpali/Desktop/brackets-registry/node_modules/npm/bin/npm-cli.js" "install" "--production"
npm ERR! node v6.9.5
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE

npm ERR! node-pty@0.6.3 install: `node scripts/install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the node-pty@0.6.3 install script 'node scripts/install.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the node-pty package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node scripts/install.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs node-pty
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls node-pty
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/kathpali/tmp/bracketsPackage_11744-37021-pekzoq.wb2doq1tt9/light-theme123/npm-debug.log

I think there is an issue with the node-pty version, it may not be compatible with the npm version 3.10.10

@saurabh95
Copy link
Collaborator Author

@rationalcoding I noticed why your extension was failing as in https://github.com/adobe/brackets-registry/blob/master/deps/brackets-extensibility/npm-installer.js#L117 we are checking only for packageJson.dependencies, we also need to check packageJson.dependencies.length. I will fix this in brackets and port the code to brackets-registry

@petetnt
Copy link

petetnt commented May 4, 2017

Can we update the node version? Is it really still at 0.10?

@saurabh95
Copy link
Collaborator Author

We have upgraded node version on the server to 6.9.5. Actually I had changed my node version to 0.10.25 and forgot to update it. Updated it now, also edited the error log.

@ficristo
Copy link
Collaborator

ficristo commented May 4, 2017

I'm quite sure I used node 6 and npm 3 to develop my extension, I'll check.
Do you have also an .npmrc file? It is possible my extension fails to run npm install because of it.
I think node-pty is compatible with node 6 and node 7 but it requires a c++ compiler.
I'm lost why it doesn't work on the registry...

@zaggino
Copy link
Contributor

zaggino commented May 5, 2017

Because node-pty depends on native dependencies, which have to be built upon installation, this can be a problem if build tools are not installed on the machine.

Check this: https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions

install build tools

To compile and install native addons from npm you may also need to install build tools:

sudo apt-get install -y build-essential

So the question is, are the build-essential tools installed on the registry machine?

More reading on that here: https://github.com/nodejs/node-gyp#installation

@saurabh95
Copy link
Collaborator Author

I just checked build-essential is installed on the registry machine.

@ficristo
Copy link
Collaborator

ficristo commented May 5, 2017

The check for a package.json with an empty dependencies field that was added is fine to avoid a npm install which would result in a no op, but npm install should have worked.
Why it failed in the registry?

@saurabh95
Copy link
Collaborator Author

Yeah ideally it should not fail.
Also I tried solving the issue in my local(macOS) and I was able to solve it by cleaning the npm cache, I did the same in production and restarted the app, but the issue is still there.

@zaggino
Copy link
Contributor

zaggino commented May 5, 2017

What's the content of npm-debug.log when the install fails?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
6 participants