다음 키워드로 구글링을 했다.
mc journey builder custom activity sample code
검색된 결과들 중 링크 하나를 들어가서 소스코드를 다운로드 받았다.
https://github.com/salesforce-marketingcloud/sfmc-example-jb-custom-activity?tab=readme-ov-file
VScode 에서 node app.js 실행해보았더니 오류 발생
Error: Cannot find module 'express'
다운로드 받은 곳의 설명을 다시 읽어보자
Getting Started
The quickest way to get started is to install Node.js then run the app locally:
# Install package dependencies
npm install
# Run the Express app in development mode
npm run dev
A webapp will be available at http://localhost:8080/
You will be greeted with a landing page with links to the various examples we've created.
Getting Started 를 따라했다.
PS D:\sfmc-example-jb-custom-activity-master> npm install
npm WARN old lockfile
npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm WARN old lockfile
npm WARN old lockfile This is a one-time fix-up, please be patient...
npm WARN old lockfile
npm ERR! code ENOTFOUND
npm ERR! syscall getaddrinfo
npm ERR! errno ENOTFOUND
npm ERR! network request to https://artifactory-dev.exacttarget.com/artifactory/api/npm/sfmc-npm/yargs-parser/-/yargs-parser-13.1.2.tgz failed, reason: getaddrinfo ENOTFOUND artifactory-dev.exacttarget.com
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
npm ERR! A complete log of this run can be found in: C:\Users\niceb\AppData\Local\npm-cache\_logs\2024-01-18T06_19_10_323Z-debug-0.log
PS D:\sfmc-example-jb-custom-activity-master> npm run dev
> sfmc-jb-custom-activity-example@0.0.1 dev
> concurrently "npm start" "webpack --watch"
'concurrently'은(는) 내부 또는 외부 명령, 실행할 수 있는 프로그램, 또는
배치 파일이 아닙니다.
package-lock.json 에 설정된 url 이 web browser 로 접근해보면 유효하지 않음
"yargs-parser": {
"version": "13.1.2",
"resolved": "https://artifactory-dev.exacttarget.com:443/artifactory/api/npm/sfmc-npm/yargs-parser/-/yargs-parser-13.1.2.tgz",
"integrity": "sha1-Ew8JcC667vJlDVTObj5XBvek+zg=",
"dev": true,
"requires": {
"camelcase": "^5.0.0",
"decamelize": "^1.2.0"
}
}