SAP / generator-easy-ui5

Meta-generator various project types within the UI5 Universe
https://blogs.sap.com/2021/04/09/easy-ui5-3.0-from-community-contributions-to-community-plugins/
Apache License 2.0
243 stars 72 forks source link

Cannot create "app" after "yo easy-ui5 project" #122

Closed sonip1992 closed 1 year ago

sonip1992 commented 1 year ago

After this fix - https://github.com/ui5-community/generator-ui5-project/pull/67, when i try to create an app with easy-ui5 project i get below errors:

`Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@sap-ux/fe-fpm-writer' imported from C:\Users\USER\AppData\Roaming\npm\node_modules\generator-easy-ui5\plugin-generators\generator-ui5-project\generators\enablefpm\index.js at new NodeError (node:internal/errors:399:5) at packageResolve (node:internal/modules/esm/resolve:889:9) at moduleResolve (node:internal/modules/esm/resolve:938:20) at defaultResolve (node:internal/modules/esm/resolve:1153:11) at nextResolve (node:internal/modules/esm/loader:163:28) at ESMLoader.resolve (node:internal/modules/esm/loader:838:30) at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18) at ModuleWrap. (node:internal/modules/esm/module_job:77:40) at link (node:internal/modules/esm/module_job:76:36)

Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@sap-ux/fe-fpm-writer' imported from C:\Users\USER\AppData\Roaming\npm\node_modules\generator-easy-ui5\plugin-generators\generator-ui5-project\generators\enablefpm\index.js at new NodeError (node:internal/errors:399:5) at packageResolve (node:internal/modules/esm/resolve:889:9) at moduleResolve (node:internal/modules/esm/resolve:938:20) at defaultResolve (node:internal/modules/esm/resolve:1153:11) at nextResolve (node:internal/modules/esm/loader:163:28) at ESMLoader.resolve (node:internal/modules/esm/loader:838:30) at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18) at ModuleWrap. (node:internal/modules/esm/module_job:77:40) at link (node:internal/modules/esm/module_job:76:36)

Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@sap-ux/fe-fpm-writer' imported from C:\Users\USER\AppData\Roaming\npm\node_modules\generator-easy-ui5\plugin-generators\generator-ui5-project\generators\newfpmpage\index.js at new NodeError (node:internal/errors:399:5) at packageResolve (node:internal/modules/esm/resolve:889:9) at moduleResolve (node:internal/modules/esm/resolve:938:20) at defaultResolve (node:internal/modules/esm/resolve:1153:11) at nextResolve (node:internal/modules/esm/loader:163:28) at ESMLoader.resolve (node:internal/modules/esm/loader:838:30) at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18) at ModuleWrap. (node:internal/modules/esm/module_job:77:40) at link (node:internal/modules/esm/module_job:76:36)

Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@sap-ux/fe-fpm-writer' imported from C:\Users\USER\AppData\Roaming\npm\node_modules\generator-easy-ui5\plugin-generators\generator-ui5-project\generators\newfpmpage\index.js at new NodeError (node:internal/errors:399:5) at packageResolve (node:internal/modules/esm/resolve:889:9) at moduleResolve (node:internal/modules/esm/resolve:938:20) at defaultResolve (node:internal/modules/esm/resolve:1153:11) at nextResolve (node:internal/modules/esm/loader:163:28) at ESMLoader.resolve (node:internal/modules/esm/loader:838:30) at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18) at ModuleWrap. (node:internal/modules/esm/module_job:77:40) at link (node:internal/modules/esm/module_job:76:36)

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'valid-filename' imported from C:\Users\USER\AppData\Roaming\npm\node_modules\generator-easy-ui5\plugin-generators\generator-ui5-project\generators\newopa5po\index.js at new NodeError (node:internal/errors:399:5) at packageResolve (node:internal/modules/esm/resolve:889:9) at moduleResolve (node:internal/modules/esm/resolve:938:20) at defaultResolve (node:internal/modules/esm/resolve:1153:11) at nextResolve (node:internal/modules/esm/loader:163:28) at ESMLoader.resolve (node:internal/modules/esm/loader:838:30) at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18) at ModuleWrap. (node:internal/modules/esm/module_job:77:40) at link (node:internal/modules/esm/module_job:76:36)

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'valid-filename' imported from C:\Users\USER\AppData\Roaming\npm\node_modules\generator-easy-ui5\plugin-generators\generator-ui5-project\generators\newopa5po\index.js at new NodeError (node:internal/errors:399:5) at packageResolve (node:internal/modules/esm/resolve:889:9) at moduleResolve (node:internal/modules/esm/resolve:938:20) at defaultResolve (node:internal/modules/esm/resolve:1153:11) at nextResolve (node:internal/modules/esm/loader:163:28) at ESMLoader.resolve (node:internal/modules/esm/loader:838:30) at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18) at ModuleWrap. (node:internal/modules/esm/module_job:77:40) at link (node:internal/modules/esm/module_job:76:36)

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'valid-filename' imported from C:\Users\USER\AppData\Roaming\npm\node_modules\generator-easy-ui5\plugin-generators\generator-ui5-project\generators\newopa5journey\index.js at new NodeError (node:internal/errors:399:5) at packageResolve (node:internal/modules/esm/resolve:889:9) at moduleResolve (node:internal/modules/esm/resolve:938:20) at defaultResolve (node:internal/modules/esm/resolve:1153:11) at nextResolve (node:internal/modules/esm/loader:163:28) at ESMLoader.resolve (node:internal/modules/esm/loader:838:30) at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18) at ModuleWrap. (node:internal/modules/esm/module_job:77:40) at link (node:internal/modules/esm/module_job:76:36)

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'valid-filename' imported from C:\Users\USER\AppData\Roaming\npm\node_modules\generator-easy-ui5\plugin-generators\generator-ui5-project\generators\newopa5journey\index.js at new NodeError (node:internal/errors:399:5) at packageResolve (node:internal/modules/esm/resolve:889:9) at moduleResolve (node:internal/modules/esm/resolve:938:20) at defaultResolve (node:internal/modules/esm/resolve:1153:11) at nextResolve (node:internal/modules/esm/loader:163:28) at ESMLoader.resolve (node:internal/modules/esm/loader:838:30) at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18) at ModuleWrap. (node:internal/modules/esm/module_job:77:40) at link (node:internal/modules/esm/module_job:76:36)

Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@sap-ux/ui5-application-writer' imported from C:\Users\USER\AppData\Roaming\npm\node_modules\generator-easy-ui5\plugin-generators\generator-ui5-project\generators\newwebapp\index.js at new NodeError (node:internal/errors:399:5) at packageResolve (node:internal/modules/esm/resolve:889:9) at moduleResolve (node:internal/modules/esm/resolve:938:20) at defaultResolve (node:internal/modules/esm/resolve:1153:11) at nextResolve (node:internal/modules/esm/loader:163:28) at ESMLoader.resolve (node:internal/modules/esm/loader:838:30) at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18) at ModuleWrap. (node:internal/modules/esm/module_job:77:40) at link (node:internal/modules/esm/module_job:76:36)

Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@sap-ux/ui5-application-writer' imported from C:\Users\USER\AppData\Roaming\npm\node_modules\generator-easy-ui5\plugin-generators\generator-ui5-project\generators\newwebapp\index.js at new NodeError (node:internal/errors:399:5) at packageResolve (node:internal/modules/esm/resolve:889:9) at moduleResolve (node:internal/modules/esm/resolve:938:20) at defaultResolve (node:internal/modules/esm/resolve:1153:11) at nextResolve (node:internal/modules/esm/loader:163:28) at ESMLoader.resolve (node:internal/modules/esm/loader:838:30) at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18) at ModuleWrap. (node:internal/modules/esm/module_job:77:40) at link (node:internal/modules/esm/module_job:76:36)

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'object-assign-deep' imported from C:\Users\USER\AppData\Roaming\npm\node_modules\generator-easy-ui5\plugin-generators\generator-ui5-project\helpers\fileaccess.js at new NodeError (node:internal/errors:399:5) at packageResolve (node:internal/modules/esm/resolve:889:9) at moduleResolve (node:internal/modules/esm/resolve:938:20) at defaultResolve (node:internal/modules/esm/resolve:1153:11) at nextResolve (node:internal/modules/esm/loader:163:28) at ESMLoader.resolve (node:internal/modules/esm/loader:838:30) at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18) at ModuleWrap. (node:internal/modules/esm/module_job:77:40) at link (node:internal/modules/esm/module_job:76:36)

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'object-assign-deep' imported from C:\Users\USER\AppData\Roaming\npm\node_modules\generator-easy-ui5\plugin-generators\generator-ui5-project\helpers\fileaccess.js at new NodeError (node:internal/errors:399:5) at packageResolve (node:internal/modules/esm/resolve:889:9) at moduleResolve (node:internal/modules/esm/resolve:938:20) at defaultResolve (node:internal/modules/esm/resolve:1153:11) at nextResolve (node:internal/modules/esm/loader:163:28) at ESMLoader.resolve (node:internal/modules/esm/loader:838:30) at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18) at ModuleWrap. (node:internal/modules/esm/module_job:77:40) at link (node:internal/modules/esm/module_job:76:36)

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'object-assign-deep' imported from C:\Users\USER\AppData\Roaming\npm\node_modules\generator-easy-ui5\plugin-generators\generator-ui5-project\helpers\fileaccess.js at new NodeError (node:internal/errors:399:5) at packageResolve (node:internal/modules/esm/resolve:889:9) at moduleResolve (node:internal/modules/esm/resolve:938:20) at defaultResolve (node:internal/modules/esm/resolve:1153:11) at nextResolve (node:internal/modules/esm/loader:163:28) at ESMLoader.resolve (node:internal/modules/esm/loader:838:30) at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18) at ModuleWrap. (node:internal/modules/esm/module_job:77:40) at link (node:internal/modules/esm/module_job:76:36)

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'object-assign-deep' imported from C:\Users\USER\AppData\Roaming\npm\node_modules\generator-easy-ui5\plugin-generators\generator-ui5-project\helpers\fileaccess.js at new NodeError (node:internal/errors:399:5) at packageResolve (node:internal/modules/esm/resolve:889:9) at moduleResolve (node:internal/modules/esm/resolve:938:20) at defaultResolve (node:internal/modules/esm/resolve:1153:11) at nextResolve (node:internal/modules/esm/loader:163:28) at ESMLoader.resolve (node:internal/modules/esm/loader:838:30) at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18) at ModuleWrap. (node:internal/modules/esm/module_job:77:40) at link (node:internal/modules/esm/module_job:76:36)

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'object-assign-deep' imported from C:\Users\USER\AppData\Roaming\npm\node_modules\generator-easy-ui5\plugin-generators\generator-ui5-project\helpers\fileaccess.js at new NodeError (node:internal/errors:399:5) at packageResolve (node:internal/modules/esm/resolve:889:9) at moduleResolve (node:internal/modules/esm/resolve:938:20) at defaultResolve (node:internal/modules/esm/resolve:1153:11) at nextResolve (node:internal/modules/esm/loader:163:28) at ESMLoader.resolve (node:internal/modules/esm/loader:838:30) at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18) at ModuleWrap. (node:internal/modules/esm/module_job:77:40) at link (node:internal/modules/esm/module_job:76:36)

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'object-assign-deep' imported from C:\Users\USER\AppData\Roaming\npm\node_modules\generator-easy-ui5\plugin-generators\generator-ui5-project\helpers\fileaccess.js at new NodeError (node:internal/errors:399:5) at packageResolve (node:internal/modules/esm/resolve:889:9) at moduleResolve (node:internal/modules/esm/resolve:938:20) at defaultResolve (node:internal/modules/esm/resolve:1153:11) at nextResolve (node:internal/modules/esm/loader:163:28) at ESMLoader.resolve (node:internal/modules/esm/loader:838:30) at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18) at ModuleWrap. (node:internal/modules/esm/module_job:77:40) at link (node:internal/modules/esm/module_job:76:36)

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'object-assign-deep' imported from C:\Users\USER\AppData\Roaming\npm\node_modules\generator-easy-ui5\plugin-generators\generator-ui5-project\helpers\fileaccess.js at new NodeError (node:internal/errors:399:5) at packageResolve (node:internal/modules/esm/resolve:889:9) at moduleResolve (node:internal/modules/esm/resolve:938:20) at defaultResolve (node:internal/modules/esm/resolve:1153:11) at nextResolve (node:internal/modules/esm/loader:163:28) at ESMLoader.resolve (node:internal/modules/esm/loader:838:30) at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18) at ModuleWrap. (node:internal/modules/esm/module_job:77:40) at link (node:internal/modules/esm/module_job:76:36)

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'object-assign-deep' imported from C:\Users\USER\AppData\Roaming\npm\node_modules\generator-easy-ui5\plugin-generators\generator-ui5-project\helpers\fileaccess.js at new NodeError (node:internal/errors:399:5) at packageResolve (node:internal/modules/esm/resolve:889:9) at moduleResolve (node:internal/modules/esm/resolve:938:20) at defaultResolve (node:internal/modules/esm/resolve:1153:11) at nextResolve (node:internal/modules/esm/loader:163:28) at ESMLoader.resolve (node:internal/modules/esm/loader:838:30) at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18) at ModuleWrap. (node:internal/modules/esm/module_job:77:40) at link (node:internal/modules/esm/module_job:76:36)

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'object-assign-deep' imported from C:\Users\USER\AppData\Roaming\npm\node_modules\generator-easy-ui5\plugin-generators\generator-ui5-project\helpers\fileaccess.js at new NodeError (node:internal/errors:399:5) at packageResolve (node:internal/modules/esm/resolve:889:9) at moduleResolve (node:internal/modules/esm/resolve:938:20) at defaultResolve (node:internal/modules/esm/resolve:1153:11) at nextResolve (node:internal/modules/esm/loader:163:28) at ESMLoader.resolve (node:internal/modules/esm/loader:838:30) at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18) at ModuleWrap. (node:internal/modules/esm/module_job:77:40) at link (node:internal/modules/esm/module_job:76:36)

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'object-assign-deep' imported from C:\Users\USER\AppData\Roaming\npm\node_modules\generator-easy-ui5\plugin-generators\generator-ui5-project\helpers\fileaccess.js at new NodeError (node:internal/errors:399:5) at packageResolve (node:internal/modules/esm/resolve:889:9) at moduleResolve (node:internal/modules/esm/resolve:938:20) at defaultResolve (node:internal/modules/esm/resolve:1153:11) at nextResolve (node:internal/modules/esm/loader:163:28) at ESMLoader.resolve (node:internal/modules/esm/loader:838:30) at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18) at ModuleWrap. (node:internal/modules/esm/module_job:77:40) at link (node:internal/modules/esm/module_job:76:36)

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'object-assign-deep' imported from C:\Users\USER\AppData\Roaming\npm\node_modules\generator-easy-ui5\plugin-generators\generator-ui5-project\helpers\fileaccess.js at new NodeError (node:internal/errors:399:5) at packageResolve (node:internal/modules/esm/resolve:889:9) at moduleResolve (node:internal/modules/esm/resolve:938:20) at defaultResolve (node:internal/modules/esm/resolve:1153:11) at nextResolve (node:internal/modules/esm/loader:163:28) at ESMLoader.resolve (node:internal/modules/esm/loader:838:30) at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18) at ModuleWrap. (node:internal/modules/esm/module_job:77:40) at link (node:internal/modules/esm/module_job:76:36)`

I tried manually installing the packages and they got installed but even after this, i get the same error, This is on windows.

I am not entirely sure whether the above fix has caused the issue or not, it just added from chronology perspective as earlier i faced issue that was fixed by above PR and after i updated all my packages, i run the command to create the app and it fails with above error.

petermuessig commented 1 year ago

Hi @sonip1992,

did you try to run npm install in the following directory: C:\Users\USER\AppData\Roaming\npm\node_modules\generator-easy-ui5\plugin-generators\generator-ui5-project\?

Maybe there is an issue with the npm install in the plugin generators. I think we need to fix this in general with making Easy UI5 to install the plugin generators in the users home directory rather than nested in the NPM package. This leads to strange issues...

BTW: when exactly did the error occur? just by creating app?

THX, Peter

sonip1992 commented 1 year ago

Hello @petermuessig,

Yes, the error came only after i hit enter on selecting the app.

after running npm install in the directory, i was able to create the app. Although, since we installed the generator with -g flag, we should not need to go to the directory and run npm install. Like you mentioned, it could be some issue with the npm for plugin generators.

For now i am unblocked. Though there were few warnings related to deprecation of certain versions of some modules. Not sure if this should be of any concern.

npm WARN deprecated @npmcli/move-file@2.0.1: This functionality has been moved to @npmcli/fs npm WARN deprecated @npmcli/move-file@2.0.1: This functionality has been moved to @npmcli/fs npm WARN deprecated babel-preset-es2015@6.24.1: 🙌 Thanks for using Babel: we recommend using babel-preset-env now: please read https://babeljs.io/env to update! npm WARN deprecated har-validator@5.1.5: this library is no longer supported npm WARN deprecated libnpmconfig@1.2.1: This module is not used anymore. npm config is parsed by npm itself and by @npmcli/config npm WARN deprecated libnpmconfig@1.2.1: This module is not used anymore. npm config is parsed by npm itself and by @npmcli/config npm WARN deprecated scmp@1.0.0: scmp v2 uses improved core crypto comparison since Node v6.6.0 npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142 npm WARN deprecated core-js@2.6.12: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.

Thanks for the hint regarding npm install in the directory.

Regards, Prashant

petermuessig commented 1 year ago

Big thanks for confirming that npm install fixes the issue. I think, the problem is related to updating the package but not running npm install properly. I'll check this and keep this issue open until this is fixed...

sonip1992 commented 1 year ago

Oh yes, correct the issue seems to be with updating of the packages.

Thanks!