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

Deployment not working using Nunjucks #1073

Closed
simranprdxn opened this issue Feb 22, 2018 · 10 comments
Closed

Deployment not working using Nunjucks #1073

simranprdxn opened this issue Feb 22, 2018 · 10 comments

Comments

@simranprdxn
Copy link

Hi Guys,

Please help, why this could be a problem?

nunjucks@3.1.0 postinstall /tmp/deployment/application/node_modules/nunjucks
postinstall-build src

module.js:471
throw err;
^

Error: Cannot find module './index'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (/tmp/deployment/application/node_modules/.bin/postinstall-build:2:1)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)

@fdintino
Copy link
Collaborator

What command are you using to install?

@simranprdxn
Copy link
Author

simranprdxn commented Feb 22, 2018

@fdintino : npm install

5383 info lifecycle nunjucks@3.1.0~postinstall: Failed to exec postinstall script
5384 verbose stack Error: nunjucks@3.1.0 postinstall: postinstall-build src
5384 verbose stack Exit status 1
5384 verbose stack at EventEmitter. (/opt/elasticbeanstalk/node-install/node-v6.10.0-linux-x64/lib/node_modules/npm/lib/utils/lifecycle.js:255:16)
5384 verbose stack at emitTwo (events.js:106:13)
5384 verbose stack at EventEmitter.emit (events.js:191:7)
5384 verbose stack at ChildProcess. (/opt/elasticbeanstalk/node-install/node-v6.10.0-linux-x64/lib/node_modules/npm/lib/utils/spawn.js:40:14)
5384 verbose stack at emitTwo (events.js:106:13)
5384 verbose stack at ChildProcess.emit (events.js:191:7)
5384 verbose stack at maybeClose (internal/child_process.js:877:16)
5384 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)

@fdintino
Copy link
Collaborator

A few things that might help me sort this out:

  • what version of npm are you using. Any chance you could upgrade it?
  • If you're running npm install in a place that already has files, consider clearing out whatever you can before running it again. So, for instance, if /tmp/deployment/application/node_modules exists before you run the command, try deleting it first and starting from scratch.

@fdintino
Copy link
Collaborator

fdintino commented Feb 22, 2018

Also, putting the full npm install output in a gist and posting that here might provide useful context.

@boccob
Copy link

boccob commented Feb 23, 2018

I have the same issue. Can be easily reproduced with npm install nunjucks --no-bin-links (node v9.2.1 and npm v5.6.0).

@fdintino
Copy link
Collaborator

Could you check if this is fixed with the 3.1.1 release of nunjucks?

@Ryanmtate
Copy link

Hi @fdintino

Ran into this issue today:

> nunjucks@3.1.1 postinstall 

node_modules/nunjucks
> node scripts/postinstall-build.js src

module.js:515
    throw err;
    ^

Error: Cannot find module 'node_modules/nunjucks/scripts/postinstall-build.js'
    at Function.Module._resolveFilename (module.js:513:15)
    at Function.Module._load (module.js:463:25)
    at Function.Module.runMain (module.js:653:10)
    at startup (bootstrap_node.js:187:16)
    at bootstrap_node.js:608:3

@fdintino
Copy link
Collaborator

Sorry about that. I'll need to add some test coverage around npm packaging. Could you check once more to see whether the 3.1.2 release addresses your issues?

@fdintino
Copy link
Collaborator

I'm going to assume that this issue is resolved. Please feel free to reopen to let me know if it is still an issue.

@boccob
Copy link

boccob commented Feb 27, 2018

Works fine for me. Thank you for the fix!

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

No branches or pull requests

4 participants