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

The asset manager ended with an error #3

Closed
schmunk42 opened this issue Sep 12, 2017 · 8 comments
Closed

The asset manager ended with an error #3

schmunk42 opened this issue Sep 12, 2017 · 8 comments
Labels

Comments

@schmunk42
Copy link
Contributor

schmunk42 commented Sep 12, 2017

Running in a Docker container...

/ # ./composer.phar require foxy/foxy:@dev
Do not run Composer as root/super user! See https://getcomposer.org/root for details
./composer.json has been created
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
  - Installing foxy/foxy (dev-master 8857b24): Cloning 8857b2426a from cache
Writing lock file
Generating autoload files
Installing npm dependencies
npm ERR! Linux 4.9.0-3-amd64
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! node v6.7.0
npm ERR! npm  v3.10.3
npm ERR! code EINVALIDTYPE

npm ERR! typeerror Error: Argument #1: Expected object but got array
npm ERR! typeerror     at moduleName (/usr/lib/node_modules/npm/lib/utils/module-name.js:25:3)
npm ERR! typeerror     at module.exports (/usr/lib/node_modules/npm/lib/utils/package-id.js:9:14)
npm ERR! typeerror     at build.linkStuff (/usr/lib/node_modules/npm/lib/build.js:105:25)
npm ERR! typeerror     at Array.<anonymous> (/usr/lib/node_modules/npm/node_modules/slide/lib/bind-actor.js:15:8)
npm ERR! typeerror     at LOOP (/usr/lib/node_modules/npm/node_modules/slide/lib/chain.js:15:14)
npm ERR! typeerror     at chain (/usr/lib/node_modules/npm/node_modules/slide/lib/chain.js:20:5)
npm ERR! typeerror     at module.exports (/usr/lib/node_modules/npm/lib/install/action/build.js:9:3)
npm ERR! typeerror     at actions.(anonymous function) (/usr/lib/node_modules/npm/lib/install/actions.js:48:12)
npm ERR! typeerror     at execAction (/usr/lib/node_modules/npm/lib/install/actions.js:98:7)
npm ERR! typeerror     at exports.doOne (/usr/lib/node_modules/npm/lib/install/actions.js:103:3)
npm ERR! typeerror This is an error with npm itself. Please report this error at:
npm ERR! typeerror     <http://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /npm-debug.log
Fallback to previous state for the Asset package
Fallback to previous state for Composer

Installation failed, deleting ./composer.json.

                                         
  [RuntimeException]                     
  The asset manager ended with an error  
                                         

require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-suggest] [--no-update] [--no-scripts] [--update-no-dev] [--update-with-dependencies] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--] [<packages>]...

[update]

Looks like a missing packages.json, should be auto-created.

@francoispluchino
Copy link
Member

Is what the command npm install (without Composer/Foxy) work in your Docker container?

@schmunk42
Copy link
Contributor Author

schmunk42 commented Sep 12, 2017

Looks like it's related to my setting ENV COMPOSER=/app/composer/composer.json in the container.
Foxy should respect this setting or a developer should be able to set a path to package.json - but the default should be, that it resides next to composer.json in the same dir.

@francoispluchino
Copy link
Member

francoispluchino commented Sep 12, 2017

Foxy works with the getcwd() function, like Composer, but actually, not with the env COMPOSER.

@schmunk42
Copy link
Contributor Author

@francoispluchino
Copy link
Member

I just checked, Foxy works with the env COMPOSER but only for the fallback.

@francoispluchino francoispluchino self-assigned this Sep 12, 2017
@francoispluchino francoispluchino added this to the 1.0.0 milestone Sep 12, 2017
@francoispluchino
Copy link
Member

I'm not sure I understand the relationship between the NPM error and the env COMPOSER.

But regarding the env COMPOSER, if you use COMPOSER, the lock file will be placed next to the Composer file with the same name. However, the dependencies will be installed in the vendor folder of the current directory (or defined with the --working-dir option or the env COMPOSER_VENDOR_DIR).

In this case, what would be the priority to define the current directory?

  1. The env COMPOSER with dirname() function
  2. The option --working-dir
  3. The getcwd() function

Currently, only 2 and 3 are available.

If the NPM error has nothing to do with COMPOSER, can you close this issue and create a new issue with this feature?

@schmunk42
Copy link
Contributor Author

When I am in the container I have the following structure:

/app/composer/composer.json
/app/composer/composer.lock
/app/composer/packages.json
/app/src
/app/vendor

My working directory (of the container) is /app, my env variable COMPOSER=/app/composer/composer.json, when I run composer with foxy it looks for a packages.json in /app, but should look - like mentioned in 1. - in /app/composer.

If the NPM error has nothing to do with COMPOSER, can you close this issue and create a new issue with this feature?

I think it's related, but I also opened a new issue.

@francoispluchino
Copy link
Member

The info if no package.json file is found is:

npm WARN saveError ENOENT: no such file or directory, open '/app/package.json'

It's a warning, not an error. I can not reproduce your error.

@francoispluchino francoispluchino removed this from the 1.0.0 milestone Sep 12, 2017
@francoispluchino francoispluchino removed their assignment Sep 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants