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

error when installing with npm install -g sane-cli ember-cli sails #59

Closed
alexjp opened this issue Jan 20, 2015 · 29 comments

Comments

Projects
None yet
9 participants
@alexjp
Copy link

commented Jan 20, 2015

Hi,

I have been using sane in projects, today trying creating a new project, i stumbled with this error:
Cannot find module '/home/alexandre/.npm-packages/lib/node_modules/sane-cli/node_modules/ember-cli/package.json'

The issue seems to be, if packages installed through npm install -g sane-cli ember-cli sails ,that problem happens.
If i then, in the folder i would create the new project, do a npm install sane-cli, it works afterwards.

Is this an issue or normal ?
Thanks!

@Globegitter

This comment has been minimized.

Copy link
Member

commented Jan 21, 2015

hmmm that is strange I did change it in such a way that you do not need ember-cli as a global dependency anymore, but and should not happen.

What OS are you on?
And what are the commands you try to run? So after npm install -g sane-cli you try to run sane new projectname and that throws this error? Does e.g. sane help work?

@alexjp

This comment has been minimized.

Copy link
Author

commented Jan 22, 2015

Sorry for taking time to answer,

I tried it on Linux os, openSUSE to be exact.
The other questions, I think sane help was working, but please let me verify later on when i get home and to that particular machine.

@robe01

This comment has been minimized.

Copy link

commented Jan 22, 2015

I'm getting the same problem. I ran 'npm install -g sails ember-cli sane-cli' and the required npm files were installed successfully. Then I proceeded to running 'sane new project -d mongo' and then I get the following error below...

Cannot find module 'c:\Users\Robert\AppData\Roaming\npm\node_modules\sane-cli\node_modules\ember-cli\package.json'

I'm running this on windows 8.1.

@alexjp

This comment has been minimized.

Copy link
Author

commented Jan 22, 2015

Tried again, and sane new project, and that error happens.

sane help outputs the normal help text.
sane version is 0.0.22

@Globegitter

This comment has been minimized.

Copy link
Member

commented Jan 23, 2015

@alexjp @robe01 Thanks for getting back to me with those errors. I will test myself today or tomorrow.

@Globegitter

This comment has been minimized.

Copy link
Member

commented Jan 23, 2015

@robe01 that is odd, I just installed again on my Windows 8.1 machine and it works fine. Can you maybe join the gitter channel https://gitter.im/artificialio/sane and we can debug more.

@catataw

This comment has been minimized.

Copy link

commented Jan 28, 2015

$ sane up

events.js:72
throw er; // Unhandled 'error' event
^
Error: spawn ENOENT
at errnoException (child_process.js:1001:11)
at Process.ChildProcess._handle.onexit (child_process.js:792:34)

windows 8.1 version 0.22

@Globegitter

This comment has been minimized.

Copy link
Member

commented Jan 28, 2015

@catataw Thanks for posting - that is a known error and Windows support needs to be fixed. See the last sentences on this blog post: http://sanestack.com/blog/new-release-and-meeting-minutes/

@catataw

This comment has been minimized.

Copy link

commented Jan 30, 2015

@Globegitter Thank you, and congratulations for the great work

@Morganjackson

This comment has been minimized.

Copy link

commented Feb 7, 2015

I was seeing the same error as @catataw but on OS X using 0.0.23. I updated node to v0.12.0 and now I get the following:

→ sane up
events.js:85
throw er; // Unhandled 'error' event
^
Error: spawn ember ENOENT
at exports._errnoException (util.js:746:11)
at Process.ChildProcess._handle.onexit (child_process.js:1046:32)
at child_process.js:1137:20
at process._tickCallback (node.js:355:11)

@kriswill

This comment has been minimized.

Copy link
Contributor

commented Feb 8, 2015

node 0.12 just came out, and I think some of the built-in module interfaces have changed. So, it's entirely possible there is some compatibility problem in some node module dependency.

@Globegitter

This comment has been minimized.

Copy link
Member

commented Feb 8, 2015

@Morganjackson That is odd, it is working on iojs 1.1.0 for me. Just quickly switched to node 0.12 and tried sane up --skip-ember. I had to reinstall the npm packages but apart from that it seems fine. Also on OS X here.

Has it been working before for you? have you tried updating all your npm packages? Also did you update the global or the local sane-cli?

@Morganjackson

This comment has been minimized.

Copy link

commented Feb 9, 2015

@Globegitter I ended up removing all packages and installed node v0.10.35 which got me back the the origianl error as seen below:

Thanks!

events.js:72
throw er; // Unhandled 'error' event
^
Error: spawn ENOENT
at errnoException (child_process.js:1011:11)
at Process.ChildProcess._handle.onexit (child_process.js:802:34)

@Morganjackson

This comment has been minimized.

Copy link

commented Feb 9, 2015

I also just noticed that running → sane generate resource user name:string age:number didnt generate the ember models.

info: Created a new controller ("user") at api/controllers/UserController.js!
info: Created a new model ("User") at api/models/User.js!

@Globegitter

This comment has been minimized.

Copy link
Member

commented Feb 9, 2015

@Morganjackson just invited you to Gitter, maybe we can do a live debugging session at some point via screenhero.

@Morganjackson

This comment has been minimized.

Copy link

commented Feb 9, 2015

@Globegitter finally got it working! I uninstalled everything and then npm install -g sails sane-cli ember-cli which did the trick.

However now I'm seeing the error below when opening http://localhost:1337/api/v1/users which crashes the whole app.

Have you seen this before?

server   | /Users/morganjackson/Desktop/EmberSails/server/api/responses/ok.js:44
server   |   else return res.guessView({ data: data }, function couldNotGuessView () {
server   |                   ^
server   | TypeError: Object #<ServerResponse> has no method 'guessView'
server   |     at Object.sendOK (/Users/morganjackson/Desktop/EmberSails/server/api/responses/ok.js:44:19)
server   |     at ServerResponse.bound [as ok] (/usr/local/lib/node_modules/sails/node_modules/lodash/dist/lodash.js:729:21)
server   |     at found (/Users/morganjackson/Desktop/EmberSails/server/api/blueprints/find.js:76:9)
server   |     at bound (/usr/local/lib/node_modules/sails/node_modules/lodash/dist/lodash.js:957:21)
server   |     at applyInOriginalCtx (/usr/local/lib/node_modules/sails/node_modules/waterline/lib/waterline/utils/normalize.js:416:80)
server   |     at wrappedCallback (/usr/local/lib/node_modules/sails/node_modules/waterline/lib/waterline/utils/normalize.js:315:18)
server   |     at _normalizeCallback.callback.success (/usr/local/lib/node_modules/sails/node_modules/waterline/node_modules/switchback/lib/normalize.js:33:31)
server   |     at _switch (/usr/local/lib/node_modules/sails/node_modules/waterline/node_modules/switchback/lib/factory.js:48:28)
server   |     at returnResults (/usr/local/lib/node_modules/sails/node_modules/waterline/lib/waterline/query/finders/basic.js:356:9)
server   |     at /usr/local/lib/node_modules/sails/node_modules/waterline/lib/waterline/query/finders/basic.js:251:16
server   |     at /usr/local/lib/node_modules/sails/node_modules/waterline/lib/waterline/query/finders/operations.js:82:7
server   |     at Object.async.each (/usr/local/lib/node_modules/sails/node_modules/waterline/node_modules/async/lib/async.js:121:20)
server   |     at /usr/local/lib/node_modules/sails/node_modules/waterline/lib/waterline/query/finders/operations.js:425:11
server   |     at /usr/local/lib/node_modules/sails/node_modules/waterline/lib/waterline/query/finders/operations.js:564:5
server   |     at Object.async.each (/usr/local/lib/node_modules/sails/node_modules/waterline/node_modules/async/lib/async.js:121:20)
server   |     at _buildChildOpts (/usr/local/lib/node_modules/sails/node_modules/waterline/lib/waterline/query/finders/operations.js:453:9)
@Globegitter

This comment has been minimized.

Copy link
Member

commented Feb 9, 2015

@Morganjackson Glad you could fix it. That is a very odd error, will look into it a bit now.

Edit: Maybe that is because we started to deactivate the view part for sails. Can you try to change line 27-29 to just:

return res.jsonx(data);

So just remove the if.

@Morganjackson

This comment has been minimized.

Copy link

commented Feb 9, 2015

@Globegitter Your a legend, worked perfectly!

@Globegitter

This comment has been minimized.

Copy link
Member

commented Feb 9, 2015

Ahh, no idea why this even comes up but you might actually have just found some minor cleanup potential.

@albertosouza

This comment has been minimized.

Copy link
Contributor

commented Feb 10, 2015

I think you could keep the views support in sails and just set the res.whantsJson based on a parameter of url like responseType

and print static html inside tags

See no javascript version of: https://novo.atencaobasica.org.br/relato/4296

sails has suport for this feature by default and help with SEO ...

@Globegitter

This comment has been minimized.

Copy link
Member

commented Feb 10, 2015

@albertosouza I think I want to keep views turned off as a default, since you have other services such as https://prerender.io/ and also https://github.com/tildeio/ember-cli-fastboot seems to be coming to us quite fast.

But I should probably add a description to the docs how to turn it back on.

@mariusmateoc

This comment has been minimized.

Copy link
Contributor

commented Feb 12, 2015

Hi,

I have the same problem on os x Yosemite. I run npm install -g sails sane-cli ember-cli then when I run sane new project I get this error:

Cannot find module '/usr/local/lib/node_modules/sane-cli/node_modules/ember-cli/package.json'

I use node 0.12.0 and for npm globals I have:

├── bower@1.3.12
├── ember-cli@0.1.15
├── grunt-cli@0.1.13
├── jshint@2.6.0
├── npm@2.5.1
├── sails@0.11.0
└── sane-cli@0.0.23

I reinstall node and all the packages but I get the same error.

@Globegitter

This comment has been minimized.

Copy link
Member

commented Feb 12, 2015

@mariusmateoc That is very strange. Have not seen this yet at all. But yeah can you try to npm rm -g ember-cli.
Seems that npm has some issues with installing these 3 packages globally at once.

@mariusmateoc

This comment has been minimized.

Copy link
Contributor

commented Feb 12, 2015

@Globegitter Thanks, removed all 3 packages with npm uninstall -g <package_name>, then I install them separately as follows:

npm install -g sails
npm install -g ember-cli
npm install -g sane-cli

Now it work as it should. Have a nice day!

@Globegitter

This comment has been minimized.

Copy link
Member

commented Feb 12, 2015

@mariusmateoc Glad you got it working. Do you think you could do a PR on the gh-pages branch to the troubleshooting section, in the docs.md file? Would be really helpful.

@Globegitter

This comment has been minimized.

Copy link
Member

commented Feb 12, 2015

Thank you for adding that @mariusmateoc

@e-karma

This comment has been minimized.

Copy link

commented Feb 23, 2015

FYI I encountered the same error, tried the uninstall/install of all 3 separately first; didn't work. Then removed lines 27 + 29 alluded to earlier, and it worked. Thanks

@Globegitter

This comment has been minimized.

Copy link
Member

commented Feb 23, 2015

@e-karma I am glad you got this working. Which lines exactly did you remove?

@albertosouza

This comment has been minimized.

Copy link
Contributor

commented Feb 23, 2015

@Globegitter thanks for sharing these options to server side rendering, will be very useful.
I was using onw sails.js build-in feature to load and render a static version of the system but https://prerender.io/ seens to be a better option

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.