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

node 7.5 / edge 7.10.1 - TypeError: require(...) is not a function #6

Open
smaglio81 opened this issue May 24, 2017 · 2 comments
Open

Comments

@smaglio81
Copy link

Hello,

Thanks for this excellent tooling.

We have a working edition of hubot installed using PoshHubot, which is running on node 5.10.1 / edge 5.0.0 / edge-ps 0.1.0-pre.

However, I tried to do a new installation and am getting errors. Upon install, chocolatey did it's job of grabbing the latest node version, 7.5. But, edge 5.0.0 isn't precompiled to work with node 7.5, so I had Install-HubotScript get the latest version, 7.10.1. Unfortunately, I get back this error:

(note: I updated node_modules/hubot/src/robot.coffee:401 to add @logger.debug "Loading #{pkg}")

...
[Wed May 24 2017 20:02:13 GMT+0000 (Coordinated Universal Time)] DEBUG Loading hubot-shipit
[Wed May 24 2017 20:02:13 GMT+0000 (Coordinated Universal Time)] DEBUG Loading edge
[Wed May 24 2017 20:02:13 GMT+0000 (Coordinated Universal Time)]
ERROR Error loading scripts from npm package - TypeError: require(...) is not a function
  at Robot.loadExternalScripts (D:\Projects\SAIT\Hubot\node_modules\hubot\src\robot.coffee:402:11, <js>:273:39)
  at D:\Projects\SAIT\Hubot\node_modules\hubot\bin\hubot:152:11, <js>:159:26
  at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:404:3)

config.json
setup script (I built a clean VM on Azure and ran this on it)
sysbot.log

I'm very new to node & edge. From the best I can tell, google results are saying that require('edge') should be returning a function which is invoked on robot.coffee:401. But, for some reason, this version of edge isn't returning a function?

Any advice would be great. Thanks!

@brucellino
Copy link

I had the same problem. slackapi/hubot-slack#197 (comment) solved it for me: Remove the slack client external script.

Hope this helps :)

@smaglio81
Copy link
Author

Thanks for advice @brucellino. Unfortunately, it didn't work for me. I didn't have hubot-slack defined in my external-scripts.json. Looks like someone else took care of that for me.

I continue to try and upgrade it, but I'm just soo unknowledgeable about nodejs that I'm not moving very fast.

The last effort was to:

  • Upgrade node from 5.10.0 to 7.10.0 (results in an error that wants version 7.10.0 of edge)
  • Upgrade edge to 5.0.0 to 7.10.0 which results in the error below.
PS C:\workspace\ApiGatewayHubot> npm install edge@7.10.0

> edge-cs@1.2.1 install C:\workspace\ApiGatewayHubot\node_modules\edge-cs
> node tools/install.js

Welcome to .NET Core!
---------------------
Learn more about .NET Core @ https://aka.ms/dotnet-docs. Use dotnet --help to see available commands or go to https://aka.ms/dotnet-cli-docs.

Telemetry
--------------
The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include command-line arguments. The data is collected by Microsoft and shared with the community.
You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell.
You can read more about .NET Core tools telemetry @ https://aka.ms/dotnet-cli-telemetry.

Configuring...
-------------------
A command is running to initially populate your local package cache, to improve restore speed and enable offline
access. This command will take up to a minute to complete and will only happen once.
Decompressing 100% 11017 ms
Expanding 100% 35125 ms
MSBUILD : error MSB1003: Specify a project or solution file. The current working directory does not contain a project or solution file.
Microsoft (R) Build Engine version 15.3.409.57025 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

MSBUILD : error MSB1003: Specify a project or solution file. The current working directory does not contain a project or solution file.

> edge@7.10.0 install C:\workspace\ApiGatewayHubot\node_modules\edge
> node tools/install.js

MSBUILD : error MSB1003: Specify a project or solution file. The current working directory does not contain a project or solution fife.
MSBUILD : error MSB1003: Specify a project or solution file. The current working directory does not contain a project or solutionn file.
Microsoft (R) Build Engine version 15.3.409.57025 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.                                                                         fi
MSBUILD : error MSB1003: Specify a project or solution file. The current working directory does not contain a project or solutionn file.
Success: platform check for edge.js: node.js x64 v7.10.0
dpb@0.0.0 C:\workspace\ApiGatewayHubot
`-- edge@7.10.0  invalid
  +-- edge-cs@1.2.1
  `-- nan@2.8.0

I'll just keep trying.

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

No branches or pull requests

2 participants