Skip to content
This repository has been archived by the owner on Dec 10, 2019. It is now read-only.

Postinstall error prevents use of edition-node-gulp (v1.3.1) as a dependency #77

Closed
teehemkay opened this issue Sep 2, 2016 · 8 comments

Comments

@teehemkay
Copy link

I am using Pattern Lab Node- Gulp Edition v1.3.0 and 'v1.3.1' on Mac|Linux.

Expected Behavior

Running

cd install/location/
npm install eedition-node-gulp

should install eedition-node-gulp as a dependency

Actual Behavior

Instead I get the following error message:

> [email protected] postinstall [...]/component-library/node_modules/edition-node-gulp
> node node_modules/patternlab-node/core/scripts/postinstall.js

module.js:457
    throw err;
    ^

Error: Cannot find module '[...]/component-library/node_modules/edition-node-gulp/node_modules/patternlab-node/core/scripts/postinstall.js'
    at Function.Module._resolveFilename (module.js:455:15)
    at Function.Module._load (module.js:403:25)
    at Module.runMain (module.js:590:10)
    at run (bootstrap_node.js:394:7)
    at startup (bootstrap_node.js:149:9)
    at bootstrap_node.js:509:3
npm WARN enoent ENOENT: no such file or directory, open '[...]/component-library/package.json'
Steps to Reproduce
cd install/location/
npm install eedition-node-gulp

The error seems to be that node is looking for the patternlab-node package in the node_modules subdirectory under edition-node-gulp instead of looking in the my project node_modules subdirectory (which contains both the patternlab-node and edition-node-gulp packages)

@teehemkay teehemkay changed the title Postinstall error prevent use of edition-node-gulp as a dependency Postinstall error prevents use of edition-node-gulp (v1.3.1) as a dependency Sep 2, 2016
@mremergo
Copy link

mremergo commented Sep 7, 2016

same error

@Karla-Isabel-Sandoval
Copy link

Karla-Isabel-Sandoval commented Sep 22, 2016

I am also getting the same error.
Running node v6.6.0

`~/courseraAlgorithms $ node courseraTestCode.js
module.js:457
throw err;
^

Error: Cannot find module '/Users/Hyacinth/courseraAlgorithms/courseraTestCode.js'
at Function.Module._resolveFilename (module.js:455:15)
at Function.Module._load (module.js:403:25)
at Module.runMain (module.js:590:10)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:509:3`

I have uninstalled node. Reinstalled it.
Ran a brew doctor. Cleared up all issues. Can't seem to figure out what is causing this issue. I need to make sure I can use node for my assignments.

@bmuenzenmeyer
Copy link
Member

@Karla-Isabel-Sandoval what does your output have to do with Pattern Lab Node or this edition? I am not understanding.

@Karla-Isabel-Sandoval
Copy link

@bmuenzenmeyer i'm getting a very similar error message to @teehemkay's and I figured this would be a good thread to watch in case there's a solution and or possible feedback .

@bmuenzenmeyer
Copy link
Member

ok @Karla-Isabel-Sandoval I was just confused because nowhere does your stack trace mention patternlab. is it part of coursera work? (cool!)

@bmuenzenmeyer
Copy link
Member

bmuenzenmeyer commented Sep 23, 2016

Just to clarify - this isn't supposed to be working right now. For the time being, the only way to use Pattern Lab Node Editions is as standalone projects.

You can still download the package or clone the repo and run npm install, but running npm install edition-node-gulp will likely not work until the CLI is more fully baked as part of https://github.com/pattern-lab/patternlab-node/milestone/20

@bmuenzenmeyer
Copy link
Member

bmuenzenmeyer commented Sep 27, 2016

@teehemkay @mremergo @Karla-Isabel-Sandoval feel free to re-try. Don't know if it will work perfectly without changing your package.json's patternlab-node entry to "patternlab-node": "2.6.0-alpha" for the shortterm

@teehemkay
Copy link
Author

@bmuenzenmeyer

Thanks for the update and sorry for the late response...

I tried a fresh install per the instructions on the README

cd install/location/
npm install edition-node-gulp

I still get a failure (no throw though) with the following message.

> [email protected] postinstall /[...]/pl/node_modules/edition-node-gulp
> node scripts/postinstall.js

Beginning Pattern Lab Node Gulp postinstall...
Beginning Pattern Lab postinstall...
 { Error: ENOENT: no such file or directory, scandir '/[...]/pl/node_modules/edition-node-gulp/node_modules'
    at Error (native)
    at Object.fs.readdirSync (fs.js:951:18)
    at detectStarterKits (/[...]/pl/node_modules/patternlab-node/core/lib/starterkit_manager.js:54:26)
    at Object.detect_starterkits (/[...]/pl/node_modules/patternlab-node/core/lib/starterkit_manager.js:72:14)
    at Object.<anonymous> (/[...]/pl/node_modules/patternlab-node/core/scripts/postinstall.js:17:45)
    at Module._compile (module.js:556:32)
    at Object.Module._extensions..js (module.js:565:10)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3)
  errno: -2,
  code: 'ENOENT',
  syscall: 'scandir',
  path: '/[...]/pl/node_modules/edition-node-gulp/node_modules' }
 An error occurred during Pattern Lab Node postinstall.
 Pattern Lab postinstall completed with errors.

Looking at the code in starterkit_manager.js

    var node_modules_path = path.join(process.cwd(), 'node_modules');
    var npm_modules = fs.readdirSync(node_modules_path)...

there seem to be an incorrect assumption that there will be a node_modules subdir under ./node_modules/edition-node-gulp/ (== process.cwd()).
But this is not necessarily the case when doing a fresh install using npm>= 3 as outline above.

OTHO, I don't know if it's related but I'm not sure I understand what you mean by

"Don't know if it will work perfectly without changing your package.json's patternlab-node entry to "patternlab-node": "2.6.0-alpha" for the shortterm

I don't have patternlab-node in my package.json, just edition-node-gulp (which in turn depends on patternlab-node).

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

No branches or pull requests

4 participants