I'm fairly new to Angular so apologies in advance if I'm missing something basic. I've downloaded the Angular 7 CLI project from https://github.com/surveyjs/surveyjs_angular_cli and then run npm i which completed but with the following error:
npm ERR! cb() never called!
npm ERR! This is an error with npm itself. Please report this error at:
npm ERR! https://npm.community
Running ng serve then gave the following error:
An unhandled exception occurred: Could not find module "@angular-devkit/build-angular" from "C:\Dev\surveyjs_angular_cli-master".
See "…\angular-errors.log" for further details. This is the total contents of the related the log file:
[error] Error: Could not find module "@angular-devkit/build-angular" from "C:\Dev\surveyjs_angular_cli-master".
at Object.resolve (C:\Users\gstott1\AppData\Roaming\npm\node_modules@angular\cli\node_modules@angular-devkit\core\node\resolve.js:151:11)
at WorkspaceNodeModulesArchitectHost.resolveBuilder (C:\Users\gstott1\AppData\Roaming\npm\node_modules@angular\cli\node_modules@angular-devkit\architect\node\node-modules-architect-host.js:31:40)
at ServeCommand.initialize (C:\Users\gstott1\AppData\Roaming\npm\node_modules@angular\cli\models\architect-command.js:134:55)
at process._tickCallback (internal/process/next_tick.js:68:7)
at Function.Module.runMain (internal/modules/cjs/loader.js:834:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
I then tried npm install --save-dev @angular-devkit/build-angular but this generated this error:
npm ERR! path git
npm ERR! code ENOENT
npm ERR! errno ENOENT
npm ERR! syscall spawn git
npm ERR! enoent Error while executing:
npm ERR! enoent undefined ls-remote -h -t ssh://git@github.com/eligrey/FileSaver.js.git
npm ERR! enoent
npm ERR! enoent
npm ERR! enoent spawn git ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
And running ng serve still generates the error:
An unhandled exception occurred: Could not find module "@angular-devkit/build-angular" from "C:\Dev\surveyjs_angular_cli-master".
We're trying to evaluate your great looking product for potential integration into our work and asset management enterprise product so any help would be greatly appreciated.
Thanks.
Hello,
I've just cloned the
surveyjs_angular_cli
repo, run thenpm i
command and thennpm start
.I havn't got any errors during
npm i
command executing.I've got two errors during compilation. I've fixed them via the https://github.com/surveyjs/surveyjs_angular_cli/commit/4c8823bc069288b6211687bb9bc99ff427d3966b and https://github.com/surveyjs/surveyjs_angular_cli/commit/b4609a4d7a583696026fdbadeca830b38444655c commits.
Could you try to get my last changed from GitHub, remove the
node_modules
and try to install node modules again?Thanks, Serge
SurveyJS Team
Thanks for your quick response Serge. I've installed GitHub desktop, cloned the project (with your changes) to a new folder, there was no node_modules folder to delete so I just opened the base folder in Visual Studio Code, ran **npm i ** which gave the same error as before. I then ran **ng serve ** and got the same error as before.
I've previously tried the other method that you detail to create the project by creating a new local project using the Angular CLI and completing the other various changes. I needed several other additional changes (which I can send you if you're interested) but eventually got the project working although there are still some JavaScript errors that seems to prevent the app from functioning 100% correctly:
ERROR TypeError: Unable to process binding "template: function(){return { name:'objecteditorproperty',afterRender:$parent.koAfterRender} }"
Message: Unable to process binding "template: function(){return { name:'propertyeditor-'+ editorTypeTemplate,data:$data.editor} }"
Message: Unable to process binding "template: function(){return { name:'propertyeditor-modal',data:$data} }"
Message: Unable to process binding "template: function(){return { name:'propertyeditor-modalcontent',data:$data} }"
Message: Unable to process binding "template: function(){return { name:'propertyeditorcontent-'+ editorTypeTemplate,data:$data,afterRender:$data.koAfterRender} }"
Message: Cannot read property 'replace' of undefined
at Object.afterRender (:4200/main.js:537)
at SurveyPropertyModalEditorCustomWidget.afterRender (:4200/vendor.js:160546)
at SurveyPropertyHtmlEditor.SurveyPropertyModalEditor.afterRender (:4200/vendor.js:160690)
at SurveyPropertyModalEditor.self.koAfterRender (:4200/vendor.js:160617)
at Object.K (:4200/vendor.js:100402)
at e (:4200/vendor.js:100486)
at a.$.Sa (:4200/vendor.js:100487)
at Function.xd (:4200/vendor.js:100416)
at Function.yd (:4200/vendor.js:100416)
at Function.ha (:4200/vendor.js:100415)
defaultErrorLogger @ :4200/vendor.js:40770
2:4200/vendor.js:40770 ERROR TypeError: Cannot read property 'length' of undefined
at Object.Ua (:4200/vendor.js:100375)
at a.a.cc (:4200/vendor.js:100495)
at Object.K (:4200/vendor.js:100402)
at y (:4200/vendor.js:100487)
at a.gc.kc (:4200/vendor.js:100489)
at Function.notifySubscribers (:4200/vendor.js:100399)
at Function.b.notifySubscribers (:4200/vendor.js:100409)
at a.gc.c [as kc] (:4200/vendor.js:100409)
at Function.notifySubscribers (:4200/vendor.js:100399)
at Function.b.notifySubscribers (:4200/vendor.js:100409)
This is the line (:4200/main.js:537) that seems to be causing the problems:
var editor = window["CKEDITOR"].replace(htmlElement);
Thanks.
Hello,
Could you try to run "npm start" instead of "ng serve" from command line? First command starts
ng
from the local application node modules while the second command runs your global installed angular package.As for the runtime error - probably the "ckeditor" package is not loaded. It doesn't affect SurveyJS libraries functionality. If you provide us with steps to reproduce this error, we'll fix it.
Thanks, Serge
SurveyJS Team