pwa-studio: npm install error/failed

Hi all ! i have problem with install PWA studio , after clone im try to npm install and its was failed :

@magento/pwa-studio@ build D:\xamp\htdocs\vuestore.local\dev-pwa lerna --scope ‘@magento/{pwa-buildpack,peregrine}’ exec – npm run build

lerna info version 3.0.6 lerna info versioning independent lerna info filter [ ‘'@magento/{pwa-buildpack,peregrine}'’ ] lerna ERR! EFILTER No packages remain after filtering [ ‘'@magento/{pwa-buildpack,peregrine}'’ ] npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! @magento/pwa-studio@ build: lerna --scope '@magento/{pwa-buildpack,peregrine}' exec -- npm run build npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the @magento/pwa-studio@ build script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.


node v8.11.4 npm 6.4.0 platform windows 10

Did somebody have same problem ?

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 24 (10 by maintainers)

Most upvoted comments

@KirillStativka would you mind updating the issue title to specify this is something that happens over Win OS? so it’s easy to catch for others under same conditions;

It seems to be related to the single-quote char ', within the build command (and also the clean command).

Please go an edit the build script (in package.json), by doing:

# in `package.json` file, replace this line:
"build": "lerna --scope '@magento/{pwa-buildpack,peregrine}' exec -- npm run build",

# with this one:
"build": "lerna --scope \"@magento/{pwa-buildpack,peregrine}\" exec -- npm run build",

after code change by running either npm install or npm run build, node process shouldn’t break in the same way as previous comment (it may break related to code stuffs, there are some merges going on these days… but shouldn’t be caused by lerna filtering package thing)


debug + root cause, within lerna

for some reason, filterPackages from lerna, behaves in a different way under Windows:

# node_modules/@lerna/filter-packages/filter-packages.js
function filterPackages(packagesToFilter, include = [], exclude = [], showPrivate) {
  const filtered = new Set(packagesToFilter);
  const patterns = [].concat(arrify(include), negate(exclude));

If build command is using ', the line that creates patterns will be ending up with an array containing wrong packages names and filter will fail to retrieve @magento/peregrine and @magento/pwa-buildpack.

## lerna, filterPackages `patterns` constant:

# on OSx
[ '@magento/{pwa-buildpack,peregrine}' ]

# on Windows - my case
[ '\'@magento/{pwa-buildpack,peregrine}\'' ]

# on Windows - issue description case:
 [ ''@magento/{pwa-buildpack,peregrine}'' ]