issue on linux #22

Closed
unicomp21 opened this Issue Dec 31, 2011 · 25 comments

Projects

None yet

6 participants

@unicomp21

npm install azure

doesn't work on ubuntu

jdavis@LittleDog:~/web$ node tablestore.js

node.js:201
       throw e; // process.nextTick error, or 'error' event on first tick
             ^
Error: Cannot find module './services/table/tableservice'
   at Function._resolveFilename (module.js:334:11)
   at Function._load (module.js:279:25)
   at Module.require (module.js:357:17)
   at require (module.js:368:17)
   at Object. (/home/jdavis/node_modules/azure/lib/azure.js:22:20)
   at Module._compile (module.js:432:26)
   at Object..js (module.js:450:10)
   at Module.load (module.js:351:31)
   at Function._load (module.js:310:12)
   at Module.require (module.js:357:17)
jdavis@LittleDog:~/web$

@glennblock
@unicomp21
@andrerod

Could you give us more information about the app you're writting ? We do run our tests in Ubuntu / Windows so it seems odd that you're getting issues with an import on ubuntu... Maybe having the actual app would help us in figuring out the issue.

In order to run the tests, I should also mention that we do run "npm install azure".

@unicomp21
@unicomp21
@andrerod

Assigning to me for investigation.

@andrerod andrerod was assigned Jan 11, 2012
@brenoferreira

I'm getting the same error on Mac OS X Lion. When I call azure.createTableService(storageAccount, storageKey, ServiceClient.CLOUD_TABLE_HOST) I get: Cannot find module './services/table/tableservice'.

@andrerod

This is strange...

Could you guys do:
npm -v
node -v

and check if your node_modules directory contains, at least, the following structure:
andre@andrerod-laptop:~/Workspace/node_modules$ ls
azure
andre@andrerod-laptop:~/Workspace/node_modules$ cd azure/node_modules/
andre@andrerod-laptop:~/Workspace/node_modules/azure/node_modules$ ls
log mime qs sax xml2js xmlbuilder

and "server.js" (or whatever is the main file in your app) is under Workspace/ (for my example).

I'm mostly asking it because i just tried this on a machine running Ubuntu 11.10 and it worked for me ... :/

@brenoferreira

npm -v: 1.0.106 node -v: 0.6.6
Inside the node_modules/azure folder, I have the following directories structure:

Brenos-MacBook-Air:azure copy brenoferreira$ ls -R
LICENSE.txt lib package.json
README.md node_modules test

./lib:
azure.js

./node_modules:
log qs xml2js
mime sax xmlbuilder

./node_modules/log:
History.md Readme.md index.html lib
Makefile examples index.js package.json

./node_modules/log/examples:
file.js file.log reader.js stdout.js

./node_modules/log/lib:
log.js

./node_modules/mime:
LICENSE mime.js test.js
README.md package.json types

./node_modules/mime/types:
mime.types node.types

./node_modules/qs:
History.md Readme.md examples.js lib test
Makefile benchmark.js index.js package.json

./node_modules/qs/lib:
querystring.js

./node_modules/qs/test:
mocha.opts parse.js stringify.js

./node_modules/sax:
AUTHORS README.md lib test
LICENSE examples package.json

./node_modules/sax/examples:
big-not-pretty.xml not-pretty.xml switch-bench.js
example.js pretty-print.js test.html
get-products.js shopping.xml test.xml
hello-world.js strict.dtd

./node_modules/sax/lib:
sax.js

./node_modules/sax/test:
buffer-overrun.js self-closing-child-strict.js
cdata-chunked.js self-closing-child.js
cdata-end-split.js self-closing-tag.js
cdata-fake-end.js stray-ending.js
cdata-multiple.js trailing-non-whitespace.js
cdata.js unquoted.js
index.js xmlns-issue-41.js
issue-23.js xmlns-rebinding.js
issue-30.js xmlns-strict.js
issue-35.js xmlns-unbound.js
issue-47.js xmlns-xml-default-prefix-attribute.js
issue-49.js xmlns-xml-default-prefix.js
parser-position.js xmlns-xml-default-redefine.js
script.js

./node_modules/xml2js:
Cakefile README.md package.json test
LICENSE lib src

./node_modules/xml2js/lib:
xml2js.js

./node_modules/xml2js/src:
xml2js.coffee

./node_modules/xml2js/test:
fixtures xml2js.test.coffee

./node_modules/xml2js/test/fixtures:
sample.xml

./node_modules/xmlbuilder:
lib package.json

./node_modules/xmlbuilder/lib:
XMLBuilder.js XMLFragment.js index.js

./test:
azure-tests.js runextendedtests.js runtests.js
extendedtestlist.txt runjshint.js testlist.txt

I've tried to install it on a Windows machine, and it worked fine. So, as a workaround, I just copied and pasted the files from Windows into the Mac.

@brenoferreira

Apparently, it's missing some files in the "lib" folder, I don't know why npm is not downloading it.

@andrerod

I see. I still haven't been able to reproduce but you're probably right that there seems to exist an issue with the packaging. We did publish the npm package from windows so it might have something to do with it. I assume it's reproducing 100% of the times on mac?

@brenoferreira

Well, it happened everytime I tried to install the package on OSX. I'll try to update NPM on the Mac and see what happens (on Windows, I'm running v1.1.0 beta 4)

@brenoferreira

Just updated NPM to version 1.1.0-2 and I'm still getting the same error.

@andrerod

@brenoferreira: I've just republished the package using the latest NPM version (1.1.0) and sent you an email so that we can try to find out what's wrong if the problem still reproduces...

@brenoferreira

I've unninstalled both Node and NPM and reinstalled everything from scratch, and I'm still getting the same error. The only file in the lib folder is azure.js.

@andrerod

Few more questions:

  • Have you cleared your npm cache ?
  • Are you sure you dont have azure as a global module somewhere ? what kind of install are you trying ? local or global ?
  • Are you sure you aint getting npm errors ?

npm http GET https://registry.npmjs.org/sax
npm http GET https://registry.npmjs.org/qs
npm http GET https://registry.npmjs.org/log
npm http GET https://registry.npmjs.org/xmlbuilder
npm http GET https://registry.npmjs.org/mime
npm http GET https://registry.npmjs.org/xml2js
npm http 304 https://registry.npmjs.org/mime
npm http 304 https://registry.npmjs.org/log
npm http 304 https://registry.npmjs.org/xmlbuilder
npm http 304 https://registry.npmjs.org/sax
npm http 304 https://registry.npmjs.org/qs
npm http 304 https://registry.npmjs.org/xml2js
azure@0.5.1 ./azure
├── xmlbuilder@0.3.1
├── xml2js@0.1.13
├── qs@0.4.0
├── mime@1.2.4
├── log@1.2.0
└── sax@0.3.5

It should output something like this.

@brenoferreira

Here's the output from the npm install azure command:

npm http GET https://registry.npmjs.org/azure
npm http 304 https://registry.npmjs.org/azure
npm http GET https://registry.npmjs.org/xml2js
npm http GET https://registry.npmjs.org/sax
npm http GET https://registry.npmjs.org/xmlbuilder
npm http GET https://registry.npmjs.org/qs
npm http GET https://registry.npmjs.org/log
npm http GET https://registry.npmjs.org/mime
npm http 304 https://registry.npmjs.org/sax
npm http 304 https://registry.npmjs.org/qs
npm http 304 https://registry.npmjs.org/xml2js
npm http 304 https://registry.npmjs.org/xmlbuilder
npm http 304 https://registry.npmjs.org/mime
npm http 304 https://registry.npmjs.org/log
azure@0.5.1 ./node_modules/azure
├── xmlbuilder@0.3.1
├── xml2js@0.1.13
├── log@1.2.0
├── qs@0.4.0
├── mime@1.2.4
└── sax@0.3.5

@andrerod

304 actually means it's cached. Could you remove the cache and see if it still happens ? just to make sure that's not the reason.

@brenoferreira

Just cleaned the cache and it worked!!! Thanks Andre!!

@andrerod

Awesome. No worries.

@andrerod andrerod closed this Jan 21, 2012
@jpgarcia

Guys, I'm having the same issue running on Mac even removing cache. The services folder is not being downloaded. I'm trying to install the latest v0.5.2 without luck

Any ideas?

@andrerod

Hi Juan,

I did publish this yesterday on windows. Let me try to publish (later today) from a non windows npm version to see if it fixes the problem.

Andre

@jpgarcia

Ok, thank you for your quick response!

@andrerod

@jpgarcia : i've updated the npm package. Seems to be working now for the folks I've asked. Could you confirm it's ok for you now also ?

Thanks,
Andre

@isaacs

Afaict, this is an issue with npm 1.0 handling packages between windows and unix, especially unixes that use gnutar (such as linux), and extra-especially unixes with a gnutar version < 1.22 or so (CentOS, the most popular Linux, ships with 1.15.1).

npm 1.1 is much more resilient to this error, since tar is done entirely in JS, and node-tar is explicitly designed to work for npm's use cases. However, if you have tarballs in the cache already, they might be broken.

I'd recommend updating to npm 1.1, clearing the cache, etc. Which you've already done :)

Please mention "@isaacs" in the bug if this happens again, or post it at https://github.com/isaacs/npm/issues. Thanks :)

@andrerod andrerod was unassigned by unicomp21 Apr 1, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment